Questions tagged [sql-server]

Microsoft SQL Server is a relational database server product by Microsoft. Its primary query languages are T-SQL and ANSI SQL.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

JoinField doesn't concatenate date type fields from database view

I'm using this code to make a join to a SQL Server database view. arcpy.management.MakeQueryTable(CEView, "CE", "USE_KEY_FIELDS", "SID") arcpy.management.JoinField(...
user avatar
  • 11
1 vote
0 answers
27 views

Joining tables by more than one field in ArcGIS Pro

I am joining multiple tables together with different aspects of chemical analysis result data. Some of the joins need to match up with more than just the field they are being joined on. (I am ...
user avatar
1 vote
1 answer
17 views

Deleted point layer reappears upon refresh in ArcGIS Pro

I've deleted a point layer from a SQL Server geodatabase in ArcGIS Pro (using the Pro UI). The deletion appears successful but upon refresh of the geodatabase, it reappears. I haven't really seen ...
user avatar
0 votes
0 answers
13 views

SQL Server WKT crosses antimeridian - sqlgeography looks normal, sqlgeometry does not

I have a WKT that crosses the antimeridian and is stored in SQL Server as a geometry. But when I read it back out it is stretched/skewed. If I take the WKT from the geometry, and create a geography ...
user avatar
1 vote
0 answers
14 views

Update a table from a geodatabse

I use a Geodatabase on SQL Server, on which I base myself to configure tables of the bors and maps. I tried to modify a few items in a table in this Geodatabase with a simple query (UPDATE...SET). I ...
user avatar
  • 21
0 votes
0 answers
29 views

Intersect points with polygons using SQL Server query from ArcGIS Enterprise Geodatabase

I have 2 databases in ArcGIS Enterprise Geodatabase in SQL Server. One database (DB_A) contains a feature class with points and the other database (DB_B) contains a feature class with polygons. I'd ...
user avatar
  • 271
0 votes
0 answers
26 views

MSSQL tables not displaying in QGIS and MapInfo depending on load process

Some tables in MSSQL are not available in QGIS or MapInfo but can be seen by Management Studio on the same machine. QGIS MapInfo The ones visible (and with geom) in QGIS were loaded using the '...
user avatar
  • 7,536
0 votes
1 answer
18 views

Dataset won't upload with datastore

I have an SQL Server database that I have connected to Portal using a datastore. There are three datasets inside this database but for some reason only one of the three datasets are actually uploading ...
user avatar
0 votes
0 answers
22 views

Batch Update GIS Data in QGIS

I am looking to batch update data in QGIS. Basically my QGIS Project data is connected to a SQL server. I have to update several hundred attributes with new data. I have the updated data in an excel ...
user avatar
  • 1
1 vote
1 answer
44 views

Does QGIS import SQL Server data or query it?

I have a SQL Server DB with about 200GB of various datapoints stored on server. When I use this datasource in QGIS from my PC would all the data be imported? I.e do I need to make sure I have 200GB ...
user avatar
  • 11
3 votes
0 answers
61 views

Efficient way to "gridify" SQLGeography shape

Read the "Background" below for full details of why I want to achieve this. Given a shape, I would like to process it in such a way that it conforms to a 0.00001 x 0.00001 degree grid. (This ...
user avatar
  • 31
0 votes
0 answers
44 views

Unable to connect ArcPy with ArcMap to MS SQL Server accessed via ArcSDE

Why can I not connect my ArcPy to our enterprise database hosted on a Microsoft SQL Server? I'm running Python 2.7, ArcMap 10.6.1, MSSQL Server 12.0 (2014) I've created an SDE connection file in ...
user avatar
0 votes
1 answer
33 views

Changing the origins of SQL Server polygon geometry

I've got a table with polygon geometries, all with their origins @ (0,0). I want to recreate these polygons with the same dimensions, but at different origin points(x,y). Because all the original ...
user avatar
  • 33
1 vote
0 answers
81 views

Converting GeoJSON point into polygon in React

I have a JSON file of areas making polygon. I have saved those files in SQL Server database so i convert GeoJSON into CSV and import in my database and now i want to connect database with React.js. ...
user avatar
1 vote
0 answers
126 views

"Driver not loaded Driver not loaded" when adding MSSQL layer in QGIS

Similar problem as here and elsewhere... When I try to Add MSSQL Spatial Layer to connect to an Azure-hosted MS SQL Server database, I get Error opening connection: Driver not loaded Driver not loaded ...
user avatar
  • 11
0 votes
0 answers
26 views

Can OpenLayers be used to show/edit electrical Single Line Diagram (SLD)

I have some spatial data source(SQL server tables with geometry fields) that contain spatial data for single line diagram or SLD(here does not stand for styled layer descriptor) of electrical networks....
user avatar
  • 804
0 votes
1 answer
90 views

Getting all Datasets and/or Feature classes and consequently spatial data from Esri Structures in MS SQL

I'm looking for query Esri data on MS SQL Server (best by using pure SQL). So far I'm using ArcPy from Esri Python toolset but that is far from being optimal. Example of iterating through the entire ...
user avatar
1 vote
1 answer
352 views

SQL Server STIntersects, STDistance and STCointains with Lat Lon points and Geometry Polygons

I need to create 3 functions in SQL Server (2017) that has to do the following: IsPointInsideTown(Point, TownCode, [SRID]) -> true/false: indicates if the point is inside the town's polygon. ...
user avatar
0 votes
1 answer
159 views

Importing feature class from ArcGIS to SQL Server using database connection gives ERROR 000210

I am trying to import one point feature table "Point" to the SQL Server using the import option by right-clicking on the database connection folder under catalog. The new file name for the ...
user avatar
  • 57
1 vote
0 answers
78 views

Datetime in ArcGIS Pro defaults to 12/30/1899

I have datetime field in a CSV with the following format: Time 2007-02-01 05:00:00+00:00 When I use the append tool in ArcGIS Pro to load data to a table on a SQL Server Enterprise geodatabase, ...
user avatar
0 votes
0 answers
62 views

Uploading ArcGIS table to SQL Server

I am able to import a table created in SQL Server into ArcMap by using database connection. Can I also do a reverse process i.e. upload an ArcMap table back into SQL Server. I am using ArcMap version ...
user avatar
  • 57
0 votes
0 answers
31 views

STBuffer is returning wrong values

I am trying to get nearest point from the given coordinates within 1km buffer in SQL. Below is the code which I am using to get nearest point DECLARE @g geometry; SET @g = geometry::STGeomFromText('...
user avatar
1 vote
0 answers
46 views

QGIS Connect to MSSQL (Esri Enterprise DB)

I have a QGIS setup for deploying map data to the field using QField where it grabs the data from a Esri file geodatabase. I recently moved the data into a Esri Enterprise DB in MSSQL and would like ...
user avatar
  • 1,159
3 votes
1 answer
47 views

MSSQL STIntersection Results in COMException

Using MS SQL Server 2019 and running the following query results in the COMException displayed below. DECLARE @Geom1 AS GEOMETRY DECLARE @Geom2 AS GEOMETRY SET @Geom1 = GEOMETRY::...
user avatar
  • 106
2 votes
1 answer
140 views

Can a self-intersecting banana polygon be made OGC-compliant in an Azure SQL Database using spatial functions?

I'm an experienced Postgres / PostGIS user fiddling with SQL Server / Azure SQL Database spatial capabilities for the first time. Banana Polygon For the banana polygon pictured above, I believe there ...
user avatar
1 vote
0 answers
89 views

Unable to import shapefile to SQL Server 2019

Windows 10; GDAL 3.3.1; QGIS 3.2; SS2019; When attempting to load any shapefile into SQL Server 2019 I'm getting column headers but no rows are importing. I've tried: Different versions of QGIS (QGIS ...
user avatar
  • 11
4 votes
1 answer
88 views

Creating circle-like area that encompasses original polygon

I'm starting with a caveat - I'm very new to this. I'm also using spectral tools in MS SQL Server, which probably isn't the best way either. I'm attempting to make a polygon that represents an area ...
user avatar
0 votes
1 answer
295 views

GDAL ogr2ogr into SQL Server Bulk Insert (BCP) not working

I'm on Windows 10 trying to use ogr2ogr to transfer a single non-spatial table from SpatiaLite to SQL Server 2016. (I'm also using this for spatial tables back the other direction (MSSQL->SQLite) ...
user avatar
  • 11
1 vote
0 answers
263 views

Convert MultiLineString geometry object in GeoJSON to WKT in SQL

I am trying to import a geographical object into SQL server from a GeoJSON file. So far i've managed to import all types of object into my database except for MultiLineString objects. I can't seem to ...
user avatar
  • 11
0 votes
1 answer
43 views

Polygon coordinates are wrong after shapefile import

I have shapefile I have imported, but the polygon coordinates are wrong. Was the shapefile exported incorrectly or is there something I'm missing. Point 30.8843 -29.9688 should fall in the boundary.
user avatar
2 votes
2 answers
267 views

ogr2ogr MSSQL BCP import failing with "connection not enabled for BCP"

I am trying to import a plain text file with approx. 8Mio rows without geometry into SQL Server 2016 via the following ogr2ogr command ogr2ogr -progress -append -nln dgi.te_import -f MSSQLSpatial &...
user avatar
0 votes
0 answers
33 views

pymssql intersect error - Cannot call methods on int

I have a SQL Statement which works fine when I use Server Managament Studio and I get the correct output: SELECT BEZ.[BEZNR6] FROM BEZ BEZ WHERE BEZ.Shape.STIntersects(geometry::Point(483889....
user avatar
  • 1
0 votes
0 answers
49 views

SQL Server Get Point With Point, Distance and Azimuth

I am looking for a way to mimic PostGIS' ST_Project or Turf.js' destination in SQL Server. What I want to do is give the function a point, a distance and either bearing or azimuth and get back a point ...
user avatar
  • 2,597
2 votes
2 answers
505 views

How to input geospatial data into MS SQL Server via Python and SQLAlchemy

I'm trying to add a GeoJSON file into the SQL Server database. I have this following script that works fine for inputting the geospatial data into MYSQL Database, thus creating a GEOMETRY type column ...
user avatar
  • 916
0 votes
0 answers
20 views

Connecting to SQL Server or PostgreSQL using ArcGIS Earth?

I'm attempting to access a PostgreSQL and SQL Server database through ArcGIS Earth. I don't see any way and I can't find the answer. Can anyone confirm whether this is possible?
user avatar
  • 53
0 votes
0 answers
57 views

How to export every record of a SQL query to its own KML file using ogr2ogr?

I'm querying an MSSQL database and then using ogr2ogr to reproject and save the output as a single KML. Areas.sql has output like: DRAINAGE FLOODTYPE GEOM Creek #1 Nuisance 0x3C0B000... Creek #1 ...
user avatar
  • 393
0 votes
0 answers
226 views

SQL Server error when creating Geography data from a Multipolygon Geometry

So, in SQL server, I have a table called Municipios, which contains a column with 2463 entries of geometry type, with their SRID set to 4326. I'm running the following Query to try to convert them to ...
user avatar
1 vote
0 answers
22 views

How to connect to a specific database with SQL Server in QGIS

I have the credentials to access the SQL Server database for the company I work. However, the user credentials it was provided to me only have the permission to access 1 specific database, called let'...
user avatar
  • 916
1 vote
1 answer
158 views

Displaying SQL Server View (not table) on QGIS 3.18

I have an SQL Server database connected to QGIS 3.18. I am able to add tables including geography data type to the map without a problem. However, I want to be able to add a 'View' (Orn_View_spatial) ...
user avatar
  • 73
1 vote
1 answer
240 views

STContains, STIntersects and STWithin return wrong result for geography loaded from WKT

I'm trying to determin whether a point is within a polygon. I created a polygon a two points with this tool: https://clydedacruz.github.io/openstreetmap-wkt-playground/ Polygon: POLYGON((18....
user avatar
  • 111
1 vote
2 answers
142 views

Cannot verify WKT polygon for use with SQL Server geometry

I am trying to create a polygon, with inside cut out, and I have created a dozen of them no problem. However, I cannot get the following point list to verify. POLYGON( (53.890253 -114.150550, 53....
user avatar
  • 113
-1 votes
1 answer
321 views

ogr2ogr cannot import data

I can successfully get a connection to my remote sql server database using: ogrinfo "MSSQL:server=my_server_name;database=my_database;Trusted_Connection=True;" But when I try to import an ...
user avatar
  • 59
1 vote
0 answers
55 views

SQLServer STArea issue with GEOMETRYCOLLECTION resulting in trillion's m2 area

I've come across a weird issue with SQL Server's handling of GEOMETRYCOLLECTION in a Geography data type resulting in an area (square meters) in the trillion's of square meters. (checked on 2014, ...
user avatar
0 votes
0 answers
78 views

MapInfo 17.0.1. Problems with SQL queries for my database

I am writing to you with the following two problems I have with MapInfo at my workplace. Recently we have changed our Microsoft SQL-Server 2003, with MapInfo Spatialware, to a Microsoft SQL Server ...
user avatar
1 vote
0 answers
34 views

QGIS does not recognize the CRS when the data is provided by SQLServer Database with Esri SDE

We have a MS SQL Server: Microsoft SQL Server 2016 database with SDE from Esri on Windows Server 2012 R2. Loading data into QGIS results in the QGIS unkown CRS dialog. If we don't select one CRS the ...
user avatar
  • 7,710
4 votes
2 answers
418 views

Speed difference MS SQL Server 2019 to PostgreSQL/PostGIS 12 for spatial data

I imported a shapefile with 3000 polygons in UTM 25832 into both databases MS SQL Server 2019 and PostgreSQL/PostGIS. Then I calculated a buffer of 1000 meters around these geometries and transferred ...
user avatar
  • 519
0 votes
1 answer
308 views

Importing a shapefile or geopackage from QGIS 3.16 to MSSQL Server 2019

I can only find PostGIS, SpatiaLite and Oracle in the database management to import layers to the respective databases. However, I can connect to MSSQL Server in QGIS and draw and save geometries in ...
user avatar
  • 519
1 vote
0 answers
188 views

Using spatial indexes on point to polygon intersection query in SQL Server

I have a table (tab_point) with about 5 million points and another table with a few thousand polygons (tab_polyg). I need to find what points intersect with what polygon (to establish a count of ...
user avatar
1 vote
1 answer
97 views

Two identical geography objects produce different STIntersects results in SQL Server 2019

Consider I have two POLYON geography object, @g1 and @g2. One from WKT and the other one converted from binary: DECLARE @g1 geography = 'POLYGON ((-45.70072144031528 70.79588950876575,-45....
user avatar
  • 11
3 votes
0 answers
177 views

QGIS Convert Shapefile to MSSQL as geography type

I am using QGIS 3.16 and SQL Server 2019. I have a shapefile loaded into the project. I have been able to successfully convert the Shapefile to a spatial dataset in SQL Server. My method for doing ...
user avatar

1
2 3 4 5
18