Skip to main content

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

Write from ArcGIS Pro into n:m tables in SQL Server database

I would like to use ArcGIS Pro to access an existing structure in SQL Server (see image) with editing options. In addition to the columns listed, the MainTable also has spatial information (X Y points)...
Immo Woschny's user avatar
1 vote
0 answers
35 views

Calculate surface area of a geography instance using StArea() in T-SQL

In my (Azure SQL Server) database I have stored polygons in the format "MULTIPOLYGON (((longitude1 latitude1, longitude2 latitude2, etc)))". I want to calculate the total surface area of ...
user11453289's user avatar
0 votes
0 answers
11 views

SQL Server: the list of tables in Data Source Manager and Browser does not refresh

Attempts to load the layer from the tables containing geo information fails with error message: invalid layer In addition, the listing of tables in Data Source Manager doesn't show the primary key ...
AlexV's user avatar
  • 1
0 votes
0 answers
24 views

Data plotting SQL database link set up in QGIS

We have a SQL database link set up in QGIS which is working well. However, the points plotted in different locations than when the points are downloaded and plotted from a non-database file. The same ...
Hamish McLauchlan's user avatar
0 votes
0 answers
31 views

SRID in ST_Geometry fails to update with ‘Define Projection’ but Esri feature class CRS does update

I need to re-define (not reproject) a CRS for a feature class in an enterprise geodatabase (SQL Server). When I use the 'Define Projection' in AGS Pro (2.9.5), the CRS shown in Esri states the proper ...
Rex's user avatar
  • 596
0 votes
0 answers
60 views

Convert WKT varchar(max) representation in SQL Server to geometry in QGIS

I have a varchar(max) column in a SQL Server table that contains WKT that I want to display in QGIS. I can't change the database, so can this be rendered as polygons in QGIS? I have seen this thread ...
Feargal Hogan's user avatar
0 votes
0 answers
45 views

Moving tables with spatial data from SQL Server to PostGIS

I need to move tables with spatial data from SQL Server running on a server to PostGIS on another server daily. My current method is using geopandas to read the tables then writing the tables to ...
Sam's user avatar
  • 11
1 vote
0 answers
41 views

Slow rendering after switching from Geopackage to SQL Server Spatial [closed]

I have a table of 13500 points, all in OSGB 27700, which was in a GeoPackage. My QGIS 3.28.1 project displayed and stylised these very quickly when panning and zooming (almost instant). I have to ...
ChrisBB's user avatar
  • 11
0 votes
0 answers
101 views

ogr2ogr MSSQL to geopackage encoding

I'm exporting data from a MSSQL server to geopackage. "C:\OSGeo4W\bin\ogr2ogr.exe" -f "GPKG" "C:\folder\tables.gpkg" "MSSQL:server=theserver;database=thedb;driver=...
Bera's user avatar
  • 74.9k
2 votes
0 answers
55 views

How do I find the length of part of a line segment that crosses a polygon boundary?

I have a street centerline table and a borough boundary polygon table. I want to select any centerlines that cross borough boundaries and also return the how much of that centerline is crossing each ...
Kurt Cederholm's user avatar
0 votes
0 answers
36 views

Connecting QGIS through to "Acquire " SQL database

I have the connection working and have a list of tables but all are showing "no geometry" There are tables with xyz coordinates available but are still showing "no geometry" Is it ...
Hamish McLauchlan's user avatar
0 votes
1 answer
126 views

Register a view in ArcGIS returns error 999999

I have created a view in an enterprise geodatabase (SQL Server) using arcpy.management.CreateDatabaseView. It shows correctly in ArcMap, and now I want to register it properly. I have done this many ...
Berend's user avatar
  • 4,757
0 votes
0 answers
70 views

GeoDjango support for Microsoft SQL Server

From what I've been researching and testing, it seems SQL Server is not fully supported by GeoDjango. Is this correct? Ive been running into errors such as "'DatabaseOperations' object has no ...
Jorge Urena's user avatar
0 votes
0 answers
64 views

STConcaveHull with MS SQL Server

MS SQL Server supports the STConvexHull function but not the STConcaveHull function. https://learn.microsoft.com/en-us/sql/t-sql/spatial-geometry/stconvexhull-geometry-data-type?view=sql-server-ver16 ...
Hakan Tugay's user avatar
0 votes
0 answers
30 views

Making GeoServer use Windows ADP to access SQL database

I will start this by saying i'm completely out of my depths with this, but alas, I will try anyways. I'm trying to create a WMS of the spatial layers in our project for our tablets to use when we are ...
Mow's user avatar
  • 175
1 vote
0 answers
104 views

Connecting QGIS to SQL server -- not showing sde

I have problem with seeing/making connection to spatial data on SQL Server with QGIS while I can normally see it (on the same SQL Server) with ArcMap. I should use the same user and password for both ...
Mart's user avatar
  • 11
1 vote
0 answers
118 views

Create dynamic layer based on a query in ArcGIS Pro: "ERROR 000055: Cannot create a Query Table for this workspace" when using "Make Query Table"

I have connected the SQL database server myserver in ArcGIS Pro. It then appears as myserver.sde under Databases in the Catalog window. Points can be visualized in a map with the fields X and Y (EPSG:...
stonebe's user avatar
  • 467
0 votes
0 answers
187 views

Utilizing spatial index in SQL Server

I have a table Points with shape column for points of geography type, and a spatial index on the column to improve performance.. CREATE TABLE Points(id VARCHAR(10) PRIMARY KEY, shape geography); ...
Sam's user avatar
  • 11
0 votes
1 answer
458 views

GeoServer 2.23 error when opening layer preview

I've made a fresh new installation of GeoServer v2.23.2 on a Windows Server 2019 machine, running on Java SE v11.0.20+9-LTS-256. Everything seems to work, except for the layer preview... Whenever I ...
Cheshire Cat's user avatar
0 votes
1 answer
189 views

Does MS SQL server actually support spatial joins?

I have tried these ways to run a spatial join select * from a join b on GEOMETRY::STWITHIN(a.geom, b.geom) = 1 select * from a join b on a.geom.STWITHIN(b.geom) = 1 Both return the error:...
user55570's user avatar
  • 156
1 vote
1 answer
264 views

Unable to load data from a shapefile to SQL Server 2019 [closed]

Windows 10; GDAL 3.3.0; QGIS 3.2; Sql Server 2019; ODBC Driver 17 for SQL Server When I try to load my shapefiles into my SQL Server no rows are loaded, only the table structure for each shapefile. I'...
FatsGordon's user avatar
1 vote
0 answers
37 views

Join all results from a one to many join in ArcGIS Pro

I want to join all possible results (up to 5 counties intersect ZIP codes) from ZIP_County_Intersect to be populated as the null County fields in ZIP_County_Dissolve. These results are coming from ...
rachel.passer's user avatar
2 votes
3 answers
295 views

Getting SQL that defines Query Feature Class using ArcPy with ArcGIS Pro

A map in my ArcGIS Pro 3.0.3 project has a layer with a Query Feature Class as its source. I can see the SQL that defines the Query Feature Class by looking at its Layer Properties. That SQL is ...
PolyGeo's user avatar
  • 65.2k
0 votes
0 answers
30 views

Trying to run TableToTable tool to export view from SQL server database to enterprise SDE in standalone Python script

I’m trying to export a view from an SDE connection to a SQL server database to new table in an enterprise SDE database. Both are saved as SDE connection files on a file share. I’m getting ERROR ...
TylerArmstrong's user avatar
0 votes
0 answers
623 views

Connecting to MSSQL Server - QGIS 3.28 & Ubuntu 23.04

I've been using QGIS + Ubuntu for some time now, great combination. Last week I've updated from Ubuntu 22.04 to Ubuntu 22.10 and subsequently to Ubuntu 23.04. During this upgrade the system has ...
Leandro Sastre's user avatar
1 vote
0 answers
60 views

Clipping line features to polygon in SQL Server

I am trying to figure out how to clip a rivers layer to a polygon layer in a view. Below is the code that I tried but I receive an error (i.e. SQL Error [4145] [S0001]: An expression of non-boolean ...
Nicole's user avatar
  • 19
0 votes
1 answer
31 views

Error in Python script while executing through enterprise geodatabase (working fine FGDB) [closed]

I have the following script: workspace = r"D:\\Python\\Cend.gdb" MEGIS_ELECTRIC_CircuitSource = "CircuitSource" Fc = "ElectricDistribution\\...
Rpandia31's user avatar
  • 141
1 vote
0 answers
322 views

How to publish or replace the data to the feature layer hosted?

A little background: My teammate has created a hosted feature layer. I access the data of hosted feature layer using ArcGIS API for Python and pull the data. The hosted feature layer he created doesn'...
SC_Python's user avatar
0 votes
0 answers
23 views

Import Texas House map PlanH414 into SQL server using ArcGIS online

I would like to know if there is a way to import a specific shapefile into SQL Server 2016. The shapefile is downloadable from https://data.capitol.texas.gov/dataset/planh414. We have access to ArcGIS ...
benik9's user avatar
  • 101
1 vote
0 answers
46 views

QGIS - Connect to DB using Task Manager (problem)

As I have a lot of layers, I am writing a plugin that will import layers through TaskManager. Script imports layers successfully into the project with some minor problems. When layers are loaded I can ...
MatijaG's user avatar
  • 11
1 vote
1 answer
426 views

Use ogr2ogr/ogrinfo to connect to MSSQL on Ubuntu Server

OS: Ubuntu Server 20.04; Software: GDAL/QGIS, ogr2ogr/ogrinfo My goal is to use ogr to pull data from MSSQL as part of a longer process that I'm working on. First step is to test out the connection ...
MidPiedmont's user avatar
1 vote
0 answers
59 views

Setup a QGIS model to run on an Ubuntu server automatically

I made a QGIS model tool that pulls a copy of two datasets from a MSSQL db and runs several sets of geoprocessing tasks and outputs a single resulting dataset to a pgSQL db. This process runs ...
MidPiedmont's user avatar
1 vote
0 answers
154 views

Is there a faster approach to change a data type on a feature class field in ArcGIS Pro 2.9.5?

I've followed the "Calculate Field Tool" steps from this article https://support.esri.com/en/technical-article/000023089 to change the data type on a field but it takes so long to copy the ...
Allex Santana's user avatar
0 votes
1 answer
82 views

Configuring the database for a new GeoNetwork Installaion

I have some questions after reading the documentation for "Configuring the database" for version 4.0.x GeoNetwork. The documentation states: "The database dialect is configured in /WEB-...
Philip Whitten's user avatar
0 votes
1 answer
30 views

Force GeoServer to make use of carriage return from SQL Server

I'm completely new to GeoServer. In desktop GIS I can use CHAR(13) in views on SQL Server to make GIS interpret a carriage return, when I visualize a label. Is this possible using GeoServer? As I ...
Joachim Mahrt's user avatar
1 vote
0 answers
224 views

Issues saving and retrieving data from MS SQL Server with QGIS

Wondering if anyone has issues with geometry not loading into QGIS when sourced from MS SQL Server for following specific case. Software specifics: MS SQL Server spatial :15.0.2000.5 Standard Edition (...
karunakar's user avatar
3 votes
0 answers
177 views

QGIS has started putting all features into one row in Attribute Table

This is a bit of an odd one. We host our data in an Microsoft SQL Server database, and until a couple of weeks ago this was working fine. We've got about 17000 rows in it, all with a geometry. When I ...
user25730's user avatar
  • 904
-2 votes
1 answer
189 views

Float data type data shows null in attribute table [duplicate]

When I tried to open table from MS SQL Server, float data type data shows null in the attribute table. It only shows only one record.
Saidatta's user avatar
0 votes
0 answers
99 views

Convert PostGIS to MS SQL inside web app using ogr2ogr.py and Docker

I am trying to convert a PostGIS database to a SQL Server database inside a running Flask app. There are three docker containers running: web: flask app postgis: PostGIS database mssql: MSSQL ...
linus's user avatar
  • 101
1 vote
0 answers
137 views

Cannot Append date field - getting NULL values

I'm working on a standalone script that appends data from a SQL Server table onto an SDE db table. When working directly in ArcGIS Pro - the append works fine, but using a standalone script - dates ...
Fire GIS Guy's user avatar
2 votes
1 answer
655 views

ArcGIS Pro unable to add SQL database object when new fields had been added

About 90% of the layers on my maps are query layers from SQL Server database connection. My typical workflow is to drag and drop the spatial objects from the Catalog pane into the map frame and then ...
aakims's user avatar
  • 21
0 votes
1 answer
701 views

SQL Server: Coordinate conversion from NZTM to WGS84

I got a table that has shape value in one of the columns. I am converting shape value into geo_json formate and calculating centroid value and saving in two columns. The coordinate system of shape ...
user2293224's user avatar
2 votes
1 answer
500 views

Loading MS SQL table into QGIS using PyQGIS

I'm hoping to have some pieces of code on hand that link QGIS to a MS SQL database. All the tables in the database lack geometry, but have X Y Z coordinates. The database is password protected but I ...
Dan Coutts's user avatar
2 votes
1 answer
311 views

Publish UTM from geoserver using mssql geometry

I have my world lat, lon coordinates insert in an ms sql geometry column like this: geometry::Point(56.120417, 10.159337, 0); I have an ms sql store in geoserver and a layer that exposes these ...
noontz's user avatar
  • 123
0 votes
0 answers
207 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 ...
Peter Bishop's user avatar
0 votes
1 answer
66 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 ...
Dan Narsavage's user avatar
0 votes
1 answer
818 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 ...
Maciej_Szypulski's user avatar
2 votes
0 answers
295 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 ...
stonebe's user avatar
  • 467
0 votes
0 answers
174 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 ...
Josh's user avatar
  • 333
0 votes
0 answers
39 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 ...
CGarden's user avatar
  • 165

1
2 3 4 5
19