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
177 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 ...
user avatar
  • 4,164
2 votes
3 answers
2k 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&...
user avatar
  • 163
1 vote
1 answer
63 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 ...
user avatar
  • 647
1 vote
0 answers
46 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 ...
user avatar
11 votes
2 answers
1k 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 ...
user avatar
0 votes
1 answer
141 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 ...
user avatar
  • 734
0 votes
0 answers
322 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 ...
user avatar
1 vote
0 answers
101 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 ...
user avatar
  • 2,284
-2 votes
1 answer
203 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 ...
user avatar
  • 9,216
0 votes
0 answers
28 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, ...
user avatar
  • 734
1 vote
1 answer
77 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 ...
user avatar
  • 13
2 votes
2 answers
188 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 ...
user avatar
  • 107
3 votes
2 answers
215 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&...
user avatar
0 votes
2 answers
123 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 ...
user avatar
  • 203
1 vote
0 answers
143 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 ...
user avatar
  • 11
0 votes
1 answer
32 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 ...
user avatar
  • 301
0 votes
0 answers
81 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....
user avatar
  • 179
0 votes
1 answer
57 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....
user avatar
  • 509
2 votes
1 answer
79 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 ...
user avatar
  • 509
0 votes
1 answer
236 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 ...
user avatar
  • 107
2 votes
1 answer
929 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 ...
user avatar
  • 107
-2 votes
1 answer
2k 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 ...
user avatar
  • 1,422
1 vote
1 answer
243 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 ...
user avatar
  • 13
1 vote
0 answers
259 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 ...
user avatar
  • 177
2 votes
1 answer
907 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:\>...
user avatar
  • 74.7k
3 votes
1 answer
3k 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 ...
user avatar
  • 370
0 votes
1 answer
101 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 ...
user avatar
1 vote
1 answer
860 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 ...
user avatar
  • 112
1 vote
1 answer
88 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 ...
user avatar
  • 33
1 vote
0 answers
97 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 ...
user avatar
0 votes
1 answer
147 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 ...
user avatar
  • 455
1 vote
2 answers
111 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, ...
user avatar
2 votes
1 answer
711 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 ...
user avatar
  • 296
1 vote
0 answers
129 views

Pre-populating list in Survey123 using SQL Server column

What I currently have is a Survey which enters the data collected from the survey in a SQL Server table, I'd like for one of those columns in that table to become the choices in another survey. If ...
user avatar
0 votes
1 answer
472 views

Use PHP form to insert geometry from WKT into SQL Server 2017

I have a PHP 7.3 form that asks the user for a Name, a WKT and an SRID. I would like to upload the WKT and SRID to SQL Server 2017 so that it creates a geometric object in Upload_WKT_Test using ...
user avatar
  • 3,633
1 vote
0 answers
159 views

ArcGIS Pro PostgreSQL SSH connection string

I am involved in a project where a SQL Server-base application is being retired and replaced with a PostgreSQL/PostGIS-based tool under development. There is a large amount of cross-checking to be ...
user avatar
  • 11
0 votes
1 answer
389 views

Using geometry stored in SQL Server table instead of WKT as input to function

I am new to SQL Server, I have a function called STVectorize that takes a geometry and breaks it down into its constituent vectors: SELECT e.[id], e.[element_id], e.[subelement_id], e.[vector_id], ...
user avatar
  • 3,633
3 votes
2 answers
1k views

Combining ST Buffer and Intersect with Where clause

I'm trying to create a buffer around a single point in a spatial entity and finding all the points from a different entity that fall within that buffer. I tried two approaches. The code below runs ...
user avatar
2 votes
1 answer
402 views

Converting ArcSDE point data from image to MSSQL geometry

I have a bunch of points in an SDE table which is currently stored in an MSSQL database. The full entry is below, while the data i'm trying to convert from binary to geometry is: ...
user avatar
0 votes
0 answers
225 views

Linking SQL Server database to ArcGIS Online

I'm not sure this is possible, and the ESRI documentation is a bit of a mess it seems. Or maybe it's not possible at all and the ESRI documentation is giving me the nearest it can. Basically, the ...
user avatar
  • 814
0 votes
1 answer
97 views

Editing Point Data Layer made from Database Table using ArcGIS Pro?

I have a project in ArcGIS Pro which is connected to a SQL Server Database. I made a point feature layer from one of the tables however I cannot add points to the layer. I connected to the database ...
user avatar
2 votes
0 answers
147 views

Passing parameters from QGIS to a SQL Server stored procedure and link this as new layer?

I'm new to QGIS and may not have understood the principle properly yet. I'm coming from database development. Question: I have a stored procedure in SQL Server that uses a date range as a parameter. ...
user avatar
  • 21
0 votes
0 answers
131 views

Deploy/ Copy Feature Class under users AD account with gis Schema,

This question is regarding to SQL Server 2017 and ArcMap or ArcMap Pro environment. Little history: Currently GIS team deploying/Copying Feature class (FC) from ArcMap 10.4 or Pro under one SQL ...
user avatar
1 vote
0 answers
49 views

Getting geodatabase to SQL Server

I am currently attempting to load in 1000 data sets I have in 1000 different tables. I need to do this in Microsoft SQL Server. My data sources are either in Excel or geodatabases. The plan is to ...
user avatar
  • 11
1 vote
2 answers
665 views

Reducing coordinate decimal places in WKT using C#?

I have imported several shapefiles into a Microsoft SQL Server 2017 database When I use the STAsText() function on geography objects I get the following WKT: SELECT [Adm0GeoBoundaryID] ,[...
user avatar
  • 203
2 votes
1 answer
235 views

Optimising Large Spatial Queries in SQL

I'm sure similar answers have been given elsewhere but no matter what I have tried I am unable to optimise this query. Details: TableA has 3.5mill records TableB Had 57000 records but I have ...
user avatar
9 votes
1 answer
2k views

"Driver not loaded Driver not loaded" when trying to connect to MSSQL database in QGIS 3.8 on MacOS

When trying to create a new MSSQL Connection, I get an error saying: Error opening connection: Driver not loaded Driver not loaded. I have tried both QGIS 3.8.0 and the newest pre-compiled QGIS 3.8.1 ...
user avatar
1 vote
1 answer
189 views

Measuring area covered by linestring

I have a trajectory given by GPS which I store as a ST_LineString() and I'd like to know the area covered by the line string. I know the "width" of the trajectory, but I'm not sure how to approach the ...
user avatar
  • 11
1 vote
0 answers
458 views

SQL Server spatial data geometry type

I'm trying to link a GeoServer application to a SQL Server Spatial Database. The spatial data has been saved as Geography, but GeoServer can read only Geometry type. So I'm using the following script ...
user avatar
  • 203
1 vote
0 answers
346 views

SQL server 2012 convert Multipolygon geometry to geography - GDA94 / MGA zone 55 coordinate reference system

Is there a way to convert geometry column value which has GDA94 / MGA zone 55 coordinate reference system into Geography value in SQL server 2012. The layer is a multipolygon layer We were having the ...
user avatar
  • 11

1
2
3 4 5
18