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
1
vote
0answers
13 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
93 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
24 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
18 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
21 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
66 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
40 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
24 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
40 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 ...
1
vote
2answers
95 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
32 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
20 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
721 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 ...
0
votes
0answers
19 views

Connect SQL Server to a Knack database with CARTO?

I want to have a whole database from Knack in SQL Server and for it to have scheduled updates. Is that possible with CARTO?
0
votes
1answer
46 views

ArcSDESQLExecute is not able to DELETE rows in one database but works in other

I have two ESRI enterprise geodatabases on SQLServer: A and B. They are almost the same database (structure) I have this code snippet in python to deleted several rows from versions: def ...
0
votes
0answers
77 views

Creating database view in ArcMap

I have the following issue when using the Create Database View tool in ArcMap. My query runs fine in Microsoft SSMS and Visual Code (with mssql extension) against the enterprise geodatabase. But for ...
0
votes
0answers
15 views

SQL Server update statement using .NET made function does not run

In SQL Server I have a table called Track containing metadata of each track and a spatial representation of it: the field Geo, which is a LineString of the geography type. In Visual Studio I developed ...
1
vote
0answers
41 views

Converting non-simple geometries to simple so ArcGIS Pro can display and process them

In SQL Server 2016 I'm using GEOMETRY::UnionAggregate to dissolve some polygons into larger ones. Here is a simplified example of my select: select ta.TRANUM, GEOMETRY::UnionAggregate(pp.SHAPE) SHAPE ...
-2
votes
1answer
68 views

How to add NON_NULLABLE field in ESRI to an existing table?

Is there any way to add NON_NULLABLE field to an existing table with existing records? Just to make it a bit more fun the field must have Field domain parameter too. And I am fine to start with having ...
0
votes
0answers
95 views

GDAL OGR2OGR from gdbtable file to SQL Server table

There is an existing SSIS package that loads a gdbtable file into SQL server table using ogr2ogr. Command used is below --config SHAPE_ENCODING "ISO-8859-1" -append -update -f MSSQLSPATIAL &...
0
votes
0answers
19 views

ArcPy cannot open tables in Enterprise geodatabase

There are several scripts that create a geodatabase, modify the schema and insert data on the database. This scripts are designed as part of a solution. In a Nightly process this scripts are called, ...
1
vote
1answer
40 views

Deleting attribute fields through SQL Server Management Studio

I have a problem. After appending annotations into the feature class on the SQL Server database I need to delete extra attribute fields that where made in the process. Usually I would just simply use ...
0
votes
0answers
60 views

Deleted fields from table in SQL server management studio and now feature class is not working properly

I am running SQL server (v10.50.6220.0) on which there are stored a couple of my geodatabases (sde schema). Recently, I inadvertently deleted some attribute fields from an annotation feature class ...
2
votes
2answers
58 views

QGIS Connection with MSSQL: does not work

With QGIS 3.14 I try to get access to a table in MSSQL with points of the GEOGRAPHY type. The table has a PK with clustered index, and a spatial index. There is a filled geometry_columns metadata ...
2
votes
1answer
81 views

How QGIS Python loop through all tables MS SQL Server?

I've got Python code on QGIS 3.12 that adds a MS SQL Server data layer to the map, but I need to add all of them. uri = QgsDataSourceUri() uri.setConnection(r"xx.xxx.xxx.xx\xxx", "xxxx&...
0
votes
0answers
31 views

How do I set the type of geometry when creating a SQL table?

The table I am trying to recreate has these properties Data Type File Geodatabase Feature Class Feature Type Simple Geometry Type Polygon <<<< WHAT I WANT TO RECREATE My target ...
1
vote
0answers
62 views

How to calculate a line from a position and bearing in SQL Server 2012 (Spatial)

Currently I've a table filled with measurements from a certain point. All the rows contain a location in Lat/Lon, a bearing in degrees and some other data containing sensor updates etc. At this moment ...
0
votes
1answer
17 views

Choose a specific geometry column of a Spatial View in a Microsoft database to plot feature points in ArcMap

I have created a Spatial View in a Microsoft SQL database (SQL Server Manamgement Studio v18.4), i.e. a View with spatial columns. This View contains the two following point geometry columns for two ...
0
votes
0answers
41 views

SQL query for adding MSSQL Layer

I want to add a mssql layer with a SQL query. It was no problem to do it for PostgreSQL but have somebody an idea of how it is working with the mssql database? uri = QgsDataSourceUri() uri....
0
votes
1answer
40 views

ArcGIS10.2 SDE relationship class referencing a deleted feature - how to clean up relationship class?

I am looking for a smart approach to cleaning up a relationship class, which consists of relationships that look at previously deleted objects. To illustrate, we have db.schema.SITE (spatial), db....
0
votes
0answers
11 views

Using SHAPE field in a covering index for SQL Server

Can I use the SHAPE field in a feature class as one field in a covering index? In addition to SHAPE, we almost always see reads on COLUMN2. I cannot create an index like this (SHAPE, COLUMN2) in ...
0
votes
0answers
70 views

SQL Server to generate points on map for web

These are my components: SQL Server 2016 with R-in-database. smb-share on a subdirectory underneath root directory of an IIS with enough rights to let R-in-database write files. Tables in ...
0
votes
0answers
69 views

Copy tables from Server Database to a Geopackage with no geometry and with geometries using PyQGIS

I am making an application in PyQGIS that uses tables that are on an SQL server. I want to make a copy of all those tables in a local Geopackage, because I want to use my application in my laptop ...
0
votes
0answers
82 views

Generate Points from inside SQL Geography

I have a shapefile which has been loaded into MS SQL-Server. Mostly polygons, but some multi-polygons as well. For each record, I need to generate a list of say 50 points that are within the polygon. ...
2
votes
1answer
38 views

How are Modifications and Deletions represented when looking at enterprise geodatabase delta (add, delete) tables?

I'm trying to understand how to make sure a delete is a proper delete and not a modification, and vice versa. I'm using ArcGIS 10.2 and Enterprise geodatabase on MS SQL Server. See below SQL: select ...
0
votes
1answer
103 views

Using Python, how to get SQL Server queried points in the map?

Since days I'm struggling with this problem, did a lot of searching - also in this forum - but did not find the answer I need. I have a layer 'Project' in QGIS that is connected to a spatial table in ...
2
votes
1answer
322 views

Using Python, how to select points within a certain radius of a certain point?

I have a spatial table in SQL Server with point features, and connected it to QGIS which neatly shows all points. Now I want to select points in this table (and show them in the map) within a certain ...
-2
votes
1answer
492 views

SQL Server how to create spatial index? ( spatial query )

I know how to do spatial query, Shape is my geometry type column. bbox is well know text format of a bounding box srid = 2229, you must specify this srid in where intersect clause ...
0
votes
1answer
88 views

GeoServer Microsoft SQLServer view not visible as WFS

I am running a GeoServer 2.16.2 that connects to a Microsoft SQL Server 2008 database using the SQL Server extension and the Microsoft JDBC Drivers. Java Version: AdoptOpenJDK: 1.8.0_242. I can ...
1
vote
0answers
150 views

QGIS 3.10.3 failing to recognize EPSG:27700 on MS SQL data

If I load data that's held in EPSG:27700 (British National Grid) on a MSSQL Spatial database (v13.0.5622.0) into an instance of QGIS 3.10 (new project, defaulted to 27700), the CRS does not get ...
0
votes
0answers
18 views

Adjusting nodes in SQL

The intranet our company is using is combining shapes to form larger shapes. This is using code that is lost in the darkest realms of extremely bad practices, but for the most part it is okay. ...
2
votes
1answer
390 views

How do I transfer data from a geopackage to MS SQL server

I am trying to upload a geopackage (created with ogr2ogr though I don't think that matters) to a MS SQL Server 2008 instance. I can't access the instance with ogrinfo all I can get is C:\>...
0
votes
0answers
650 views

Connecting to Microsoft SQL Server from QGIS

I can't connect my QGIS to SQL Server. This is my database: This is my connection configuration to QGIS If I press test connection it says "Driver not loaded". If i load database, there is ...
0
votes
1answer
31 views

Unable to connect to SQL Server tables with 10.5 ArcMap but it works with 10.7

I have a requirement where I need to connect to the SQL Server which I have created using ArcCatalog 10.7. I have a requirement where I need to now use 10.5 version. But when I attempt to connect to ...
1
vote
1answer
440 views

Convert a SQL Server Geometry into PostGIS spatial data with Python and shapely

I'm trying to migrate spatial data from a SQL Server database to a PostGIS database with Python. I need this to be automated since its not just one table, but a lot tables in a lot of databases. I am ...
1
vote
1answer
37 views

Display map object from SQL database in MapInfo with read only access to the database

I can connect MapInfo to a SQL database using a select statement to display the contents of a table in the SQL database. However, the table is not mapable and I only have read access to the database ...
1
vote
0answers
63 views

Poor performance when adding layer indexed ArcGIS Service layer to AGOL

My data sits in enterprise geoddatabases on Windows Server 2012, SQL Server manager. I often add ArcGIS Server Web services to my AGOL maps and they perform really well. However, when I add a ...
0
votes
1answer
70 views

Slow SDE Performance After Append - Geometric Network

I had an odd thing happen today, I do almost daily appends to our fiber network (fiber, splices, etc) and usually, it goes smoothly and with no complications. For some reason, I had an Append stall ...
1
vote
2answers
95 views

Convert shapefile into usable data

I am new to GIS data. Our organization uses ArcGIS to map parcels of land used for agriculture. The lowest addressable level is currently a single polygon, representing a parcel. Throughout the year, ...
2
votes
1answer
383 views

Can't convert a WKT with a Z value into a SQL Geometry value

I'm using nettopologysuite in c# to build a nettopology geometry object, and then save it as a geometry object in SQL. Generally this works fine, except i recent came up with (from a shapefile) the ...

1
2 3 4 5
18