how to make shapefile in geometry column of ms sql? I was tried ogr2ogr command like this.

ogr2ogr -f "ESRI Shapefile" "C:\temp\sqlexport.shp" "MSSQL:server=[RemoteServerIp];database=[dbname];User Id=[user];Password=[password];trust_connection=yes;" -sql "SELECT [geometrycolumn].STAsBinary() FROM [tableName] WHERE [indexColumn] = 1;" -overwrite


but I saw error message.
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

I don't know what is wrong.
The issue is that you are running your GIS programme from a domain that is not trusted by the domain in which SQL Server resides.

That are numerous methods you can use to correct this. You should discuss with your network admin/sql server admin as to the best approach.


Create a SQL Server Account and use those credentials to connect to the SQL Server &lt;-- this might be the easiest
Trust the domain in which your GIS Programme is running &lt;--I would be loath to do this