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

SDE MSSQL Server in ArcMap & QGIS

I have SDE database and want to connect the database to QGIS MSQL. i have been trying to connect to MSQL, but the connection couldn't be don as i am getting some error message.I am getting the ...
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
32 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....
0
votes
1answer
31 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
14 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
31 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
17 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
17 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
47 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
14 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
114 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
39 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
21 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
46 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
68 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
43 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
25 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
58 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
231 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
34 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
759 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
20 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
59 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
102 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
54 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
85 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
131 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
21 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
47 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
61 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
66 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
105 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
34 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
80 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
19 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
45 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
41 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
86 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
76 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
101 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
48 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
138 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
521 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
702 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
117 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
183 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 ...
2
votes
1answer
482 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:\>...

1
2 3 4 5
18