I am trying to run the SQL procedure
EXEC xp_CMDShell 'blahblah.bat'
which needs to run an ogr2ogr script to create a kml from sql. The batch file works if I run it alone but with SQL permissions it fails. I can only think that because the first line below
pushd \\server\folder ogr2ogr -f "KML" "\\server\folder\blahblah.kml" -s_srs "EPSG:28355" "MSSQL:server=blah;database=Blah;trusted_connection=yes" -sql "SELECT blah FROM blah" -t_srs "EPSG:28355" popd \\server\folder
creates temporary drive mapping to the folder SQL can't find the DLL in that location.
ERROR 1: Can't load requested DLL: Y:\ogr2ogr\gdalplugins\ogr_MSSQLSpatial.dll 126: The specified module could not be found.
I've tried running the script using a SQL credential which links to a domain user which has full access to the actual folder this DLL lives in but I still get the error.
Has anyone come across this and been able to get around it? I'm assuming you can't insert the script directly into SQL.