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
27 views

Enterprise geodatabase maintenance Esri vs. SQL Server (rebuild index and update statistics)

I'm looking at two geodatabase maintenance practices and seeing if they need to be updated/refined, and I'm noticing that these can be accomplished via ESRI tools or directly via SQL / within SQL ...
0 votes
0 answers
19 views

Creating DbGeometry instances that honor SRID

I maintain an ArcMap Add-in tasked with allowing people to see & edit some native SQL shapes in ArcMap, which of course require working with SqlGeometry and DbGeometry types. Converting between ...
0 votes
1 answer
51 views

Microsoft SQL Server "There is already an object named 'geometry_columns' in the database" error

I have trouble adding new layers to the existing MS SQL Server database. Whenever I try to add any type of spatial layer I encounter an error, as follows: [Microsoft][ODBC SQL Server Driver][SQL ...
2 votes
0 answers
44 views

Cannot add geometry layer to QGIS although geometry column is recognized

The geometry column POINT in the View (not Table) View_MyGeometry is generated in the SQL database GeoData with Microsoft SQL Server Management Studio. QGIS recognizes this column as a geometry column ...
  • 341
0 votes
0 answers
47 views

GDAL Appending Shapefile to SQL Error: Ogr2ogr ERROR 1: MSSQL extents query returned a NULL value

I have an OGR2OGR script to append a shapefile to an existing SQL table, but I get the error 'Ogr2ogr ERROR 1: MSSQL extents query returned a NULL value'. I have seen discussions with various ...
  • 103
0 votes
0 answers
23 views

High margin of error for circle point calculation

Created a circle of points, 50m, 100m, 150m and 200m from a central lat/lng (51.500421, -0.124754) using the sql functions below (one for the lat the other lng). My concern is with the accuracy of the ...
  • 65
1 vote
0 answers
20 views

Create grid around lat/lng with same spacing on the diagonal points using SQL Server

As an example I have a lat/lng circled in red below. I want to create a grid of points using SQL Server at 50m intervals up to 200m from the centre point. But those points that are on a diagonal are ...
  • 65
0 votes
0 answers
25 views

Join to MSSQL table with no geom

I'm using QGIS 3.22.5. I want to join an MS SQL Server (MSSQL) spatial table to an MSSQL non-spatial table. I don't see that I can do this. Am I missing something? Can someone tell me how to add a ...
  • 1
0 votes
0 answers
27 views

Publish a query layer from ArcGIS Pro to your GIS Server to maintain connection

I have a query layer pulling from a SQL Server database that I use within ArcGIS Pro and am wondering if there is a way I can publish this to our GIS server (10.8.1) to maintain connectivity to the ...
  • 5
0 votes
0 answers
20 views

QGIS and SQL Spatial Feature Classes with multiple Geometry Types

I have noticed when adding a multiple Geometry type SQL feature to QGIS it displays as a line and I can't see other geometries apart from line geometies. Is there a way I can see all features? I can ...
  • 103
0 votes
1 answer
43 views

GIS layers created using FME 2021 not visible in QGIS

QGIS 3.24 SQL Server 2015 I have GIS layers in SQL Server created using ogr2ogr and FME2021 All the layers are created using my machine. In my QGIS Desktop I can see all layers irrespective of how ...
0 votes
0 answers
17 views

Merging SQL Spatial Polygons in QGIS 3 Not Saving due to Incompatible Geometry Types

We have SQL Spatial tables which accept multi-polygons and even have multi-polygon features. In QGIS we can add a part to an existing polygon even if not adjacent, but when merging we can't save. The ...
  • 103
1 vote
0 answers
39 views

Check if connected to geodatabase as database owner (DBO) with ArcPy

I was wondering if anyone knows of a reasonable workflow with ArcPy, for ArcGIS Pro/Python3 (or ArcMap 10.8.1/Python2.7, but I'd prefer a solution for Pro), to check if a given *.SDE connection file ...
  • 3,803
0 votes
0 answers
86 views

Writing from file geodatabase to SQL Server 2017 instance using ogr2ogr

I'm attempting to import a large feature class from a file geodatabase to my SQL Server 2017 instance using GDAL. I have tried many different options on the ogr2ogr command and nothing seems to work. ...
  • 437
0 votes
0 answers
27 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(...
  • 11
1 vote
0 answers
106 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 ...
1 vote
1 answer
32 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 ...
0 votes
0 answers
20 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 ...
1 vote
0 answers
29 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 ...
  • 21
0 votes
1 answer
38 views

In GeoServer, when adding a layer, how to list all tables when using a "Microsoft SQL Server" store?

Presently all the tables are listed when attempting to add a layer from a SQL Server store but the schema is not shown nor used in the definition. My database has about 3k tables so I'm thinking ...
  • 2,841
0 votes
1 answer
224 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 ...
  • 271
0 votes
0 answers
98 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 '...
  • 7,766
0 votes
1 answer
20 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 ...
0 votes
0 answers
29 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 ...
  • 1
1 vote
1 answer
90 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 ...
  • 11
3 votes
0 answers
108 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 ...
  • 31
0 votes
0 answers
104 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 ...
0 votes
1 answer
45 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 ...
  • 33
1 vote
0 answers
114 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
0 answers
290 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 ...
  • 11
0 votes
0 answers
29 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....
  • 816
0 votes
1 answer
149 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 ...
1 vote
1 answer
700 views

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

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
1 answer
279 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 ...
  • 57
1 vote
0 answers
119 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
0 answers
93 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 ...
  • 57
0 votes
0 answers
57 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
0 answers
77 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 ...
  • 1,263
3 votes
1 answer
73 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::...
  • 106
2 votes
1 answer
196 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
0 answers
157 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 ...
  • 11
4 votes
1 answer
107 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 ...
1 vote
1 answer
545 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) ...
  • 31
1 vote
0 answers
390 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 ...
  • 11
0 votes
1 answer
62 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.
3 votes
2 answers
404 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 &...
2 votes
2 answers
773 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 ...
  • 918
0 votes
0 answers
322 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
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'...
  • 918
2 votes
2 answers
275 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) ...
  • 83

1
2 3 4 5
19