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
0answers
19 views

Why is my MSSQL ESRI enterprise Geodatabase so big? [closed]

I have created a mssql 2012 enterprise geodatabase with ArcGIS Desktop 10.5.1 which contains a single raster-mosaic dataset. According to the db-info, the size of the database on the MSSQL Server is ...
1
vote
0answers
13 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. ...
1
vote
0answers
34 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 ...
0
votes
0answers
21 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....
0
votes
1answer
36 views

How do I get 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 ...
1
vote
1answer
58 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. ...
0
votes
1answer
73 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 ...
1
vote
0answers
29 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, ...
0
votes
0answers
39 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 ...
0
votes
0answers
17 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('...
1
vote
0answers
26 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 ...
3
votes
1answer
33 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::...
1
vote
1answer
71 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 ...
1
vote
0answers
41 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 ...
3
votes
1answer
66 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 ...
0
votes
1answer
122 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) ...
1
vote
0answers
108 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 ...
0
votes
1answer
30 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.
2
votes
2answers
174 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 &...
0
votes
0answers
18 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....
0
votes
0answers
32 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 ...
0
votes
1answer
203 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 ...
0
votes
0answers
18 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?
0
votes
0answers
29 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 ...
0
votes
0answers
107 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 ...
1
vote
0answers
20 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'...
1
vote
1answer
70 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) ...
1
vote
1answer
99 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....
0
votes
0answers
15 views

Populate Geography data in SQL Server Management Studio GUI

Is there a specific syntax to use to populate a Geography type field in SQL Server Management Studio (SSMS). The below screenshot shows the SSMS GUI and the location field is of Geography type. I have ...
0
votes
0answers
10 views

ArcGIS - SQL Database - .iNumber tables [duplicate]

We have ArcGIS Enterprise in SQL and I see a lot of iNumber tables. I can't find information about what is the purpose, how they got created and do I need to delete them?
1
vote
2answers
61 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....
-1
votes
1answer
163 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 ...
0
votes
0answers
17 views

Geodatabase doesn't export all features into XML workspace

I try to export the database into XML workspace and when I import the XML into a new geodatabase I find that some features of latest update are missing (at least what I have identified). I'm facing ...
0
votes
0answers
70 views

SQL MERGE on Remote server - Geometry Data Type Objects exposing columns with CLR types are not allowed in distributed queries

I'm trying to merge tables. Both contain a data type of geometry. Apparently I need a passthrough query to be able to write geometry/geography type to remote server. MERGE [SERVER].[DB].[dbo].[TABLE]...
0
votes
0answers
28 views

Unable to connect to Azure SQL from ArcMap 10.6

I am trying to connect to Azure SQL MI from ArcMap 10.6, But I am getting this error while trying to connect I have tried to installing the newest ODBC driver (version 17) but still doesn't work. ...
1
vote
0answers
31 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, ...
0
votes
0answers
55 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 ...
1
vote
0answers
20 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 ...
4
votes
2answers
260 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 ...
0
votes
1answer
164 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 ...
0
votes
0answers
34 views

Display DrillHole locations in QGIS from SQL Server database source

I'm using QGIS 3.10.9, and I want to be able to display some drill hole data from my source database, which is on a SQL server. (I've been able to export the data into CSV format and display the data ...
1
vote
0answers
114 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 ...
1
vote
1answer
83 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....
3
votes
0answers
86 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 ...
1
vote
0answers
26 views

Connect to single table within a MSSQL database or terminate connection to database once layer added to QGIS project?

I'm connecting to MSSQL server '123' that contains 100s of databases and I am connecting to just database 'ABC'. 'ABC' contains roughly ~700 tables. Once I add the 'xyzTable' as a layer to my QGIS ...
0
votes
0answers
109 views

Problems with sde.next_rowid, ArcMap still uses 'old' values

Due to reasons beyond the scope of this question, I'm forced to import data into an SQL Server SDE database using SQL statements (importing using ArcGIS is not possible). The data already contains ...
2
votes
3answers
857 views

Import shapefile to SQL Server 2019 using OGR2OGR

I'm trying to import a shapefile into SQL Server 2019, running his command: ogr2ogr -progress -f "MSSQLSpatial" "MSSQL:server=XXXX;database=test;UID=XXXXX;PWD=XXXX" "MYFILE&...
1
vote
1answer
44 views

QGIS ODBC connection to mssqlserver returns only filtered data

I am connecting to an MSSQL database table which does not have a geometry type field, but has coordinates in separate columns. The ODBC connection works, but when I bring the table in to QGIS, it is ...
1
vote
0answers
26 views

Disappearing polygons when zooming in Feature Cache extent

I'm currently using ArcMap (v 10.6.1.) and an enterprise geodatabase (v 10.6.0) on SQL Server 2017. I encountered a problem, when I build Feature Cache on full map extent and zoom in to my polygon ...
11
votes
2answers
995 views

Why is SQL Server 2019's STDistance Very Slightly Different Than The Vincenty Formula? (Same Up To ~0.0001km)

I'm trying to make a C language equivalent to STDistance. Through research, I've narrowed down what STDistance uses, which apparently is the (inverse) Vincenty Formula. The problem is, I've tried ...

1
2 3 4 5
18