Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
0answers
15 views

Use PYQGIS to view MS SQL Server temporary table in QGIS

I'm working on a QGIS plugin to query a non spatial database held in MS SQL Server and to display the results of the query as a non spatial table in QGIS. I've tried the following: create global ...
0
votes
0answers
24 views

Using Django with Microsoft SQL Server to migrate model error spatial data?

I'm trying to migrate models which include spatial data (polygon and points) to Microsoft SQL Server 2017 Express. I'm able to successfully connect to my database using django-pyodbc-azure and ...
2
votes
0answers
35 views

From ESRI:103300 to EPSG:4326 in SQL Server

This question is more or less a sequel to Performance of joining tables on a geometry column with SQL Server As explained in the above link, I have a shapefile that I upload to my SQL Server DB using ...
1
vote
0answers
28 views

How to deal with decimal separator when uploading geometries to MSSQL server using shape2sql.exe?

I'm using Shape2Sql.exe to upload .shp shapefile to MSSQL server 13.0.4502.0 on a Win10 64bit laptop. I've added Shape2Sql.exe.config <?xml version="1.0" encoding="utf-8"?> <configuration>...
-1
votes
0answers
20 views

Migration ArcSDE from MS SQL Server to PostgreSQL/PostGIS [duplicate]

I have ArcGIS Enterprise Geodatabase on MS SQL Server. I want to migrate to PostgreSQL/PostGIS. I have installed and setup PostgreSQL/PostGIS. How do I import that data(with schema) to PostgreSQL/...
1
vote
1answer
23 views

24412: Not valid because the interior of a polygon with rings (2) and (1) is not connected

I've got geography in sqlserver that is invalid. Running IsValidDetailed() I get the reason as 24412: Not valid because the interior of a polygon with rings (2) and (1) is not connected. But I don'...
2
votes
1answer
32 views

Exporting SQL Server .bak files to a shapefile? [closed]

I have no experience using Microsoft SQL Server at all. Someone gave me a .bak file of their database and said that I can extract their spatial data that way. They said that they would not export them ...
0
votes
1answer
52 views

Performance of joining tables on a geometry column with SQL Server

I had a shapefile that I needed to integrate into my SQL Server DB. To do so, I used the very useful Shape2Sql.exe with which I chose 'Set SRID 4326' in the settings. I now have a table that contains ...
6
votes
1answer
84 views

ArcGIS Pro missing records in attribute table from SQL Server?

I created a table to test ArcGIS Pro 2.2.3 with an Azure SQL Server. The structure of the table is simply an OBJECTID, a shape (Point) and a text field. The table contains a set of 2 points with ...
0
votes
0answers
25 views

Microsoft SQL Server - Multi-user solution

My team and I are currently trying to apply multi-user techniques in our projects. So far we have used an ArcGIS Enterprise build for this purpose but we quickly learned there are a few limitations. (...
0
votes
0answers
34 views

Parsing Geometry to Latitude, Longitude is failing

I have a table 'geocodes_raw' of locations with Latitude and Longitude values. Loc_Nm || geocode_latitude || geocode_longitude A || 43.43044 || -80.0910793 W || 43.9114523 ...
0
votes
1answer
37 views

Identify EPSG in SQL Server

I have been trying to load a shapefile available at https://www.elections.on.ca/en/voting-in-ontario/electoral-district-shapefiles/open-use-data-product-licence-agreement/download-shapefiles.html to ...
0
votes
1answer
37 views

Connect to local Microsoft SQL Server Management Studio with QGIS

I am running SQL Server 2014 Management Studio and 2.18.16 version of QGIS. When I attempt Layer -> Add Layer -> SQL Server layer and click new: Connection name: Local Provider/DSN blank Host: ...
1
vote
0answers
33 views

ArcGIS feature layer built of SQL View not visible

I am building a custom web app using the ArcGIS JS 4.8 API with an ArcGIS Web service and I have run into an issue. The root cause that I am trying to fix is to do with features not being filtered ...
0
votes
0answers
14 views

Looking for documentation MS SQL imported database

I imported a country extract for testing with osm2sql. Got 11 tables: tMemberRole, tMemberType, tNode, tNodeTag, tRelation, tRelationCreation, tRelationTag, tTagType, tWay, tWayCreation and thatTag....
2
votes
1answer
61 views

Convert Shapefile from EPSG:5320 to 4326

I am trying to need Electoral District boundary data available at the below-mentioned link to SQL Server. https://www.elections.on.ca/en/voting-in-ontario/electoral-district-shapefiles/open-use-data-...
3
votes
1answer
85 views

ArcGIS Pro cannot read SQL Server databases with “-” in their name

I am using the latest ArcGIS Pro 2.2.1 and trying to use a geospatial database that is hosted in an Azure SQL Server. The issue is that ArcGIS Pro fails to query databases that have "-" in their name. ...
0
votes
0answers
31 views

QGIS MSSQL datatable only querying one record

I made a successful connection to a local MSSQL Database where there are no spatial tables (only datatables). I list the tables/views in the database (clicking on "Also list tables with no geometry" ...
1
vote
1answer
30 views

Stop ArcGIS 'Geodatabase Adminstration' Reporting Connection as 'DBO' Instead of My Username?

We are running ArcGIS 10.5.1 and MS SQL Server, and using an SDE connection file which is configured to use 'Operating System' credentials. When most users connect, the 'Geodatabase Administration' ...
0
votes
0answers
30 views

OSTN15 OSGB36 To ETRS89 Conversion

I am trying to write a native function in Microsoft SQL Server that can convert OSGB36 Easting/Northing To ETRS89 Latitude/Longitude Decimal Degrees. I have downloaded the OSTN Developers Pack from ...
1
vote
0answers
27 views

SaaS for high performance geographic intersections?

I have a fairly simple set of requirements, but I'm struggling to find anything that will handle them "out of the box" at scale. This could be my ignorance with GIS terms, or that there is nothing. ...
0
votes
1answer
50 views

Unable to load layers from MSSQL PyQGIS

I have a plugin that loads layers from SQL Server 2008. It has worked before but when I reset my PC, i wasn't able to backup my plugins. I am left with an older copy. Below is my python code to load ...
0
votes
1answer
13 views

MSSQL SDE_GEOMETRYnnn Tables

In my database, I've found a table (SDE_GEOMETRY276) with permissions granted to one user. My first thought was the "276" was either a layer_id or table registration_id. Searching sde_layers and ...
3
votes
1answer
73 views

SQL WKT draws well with geometry, but not with geography data type

I have a following piece of code DECLARE @g geometry; DECLARE @borders geography; SET @g = geometry::STGeomFromText('SOME WKT', 0); SET @borders = GEOGRAPHY::STGeomFromText(@g.MakeValid()....
0
votes
0answers
26 views

Editing data in nonversioned ArcSDE for SQL Server geodatabase?

Is is OK to edit geometry and delete rows from a nonversioned ArcSDE geodatabase in SQL Server? According to http://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/editing-...
0
votes
1answer
60 views

ogr2ogr Export spatial data from SQL Server to Spatialite

I am trying to export some spatial data from SQL Server 2012 to Spatialite with the following command ogr2ogr -f SQLite -update C:\tmp\Spatial.sqlite -nln "my_polygons" "MSSQL:server=host;database=...
1
vote
2answers
129 views

Using SqlGeometry.MakeValid to get a counter-clockwise polygon in SQL Server

The data I've loaded from a shapefile into a geometry column in SQL Server (using NetTopologySuite) is not producing valid GeoJSON when I export it because it doesn't follow the right-hand rule. I ...
0
votes
0answers
9 views

Most efficient process for updating attributes on AGOL from MS SQL Server data source

We have a source system running MS SQL. There are attributes in this database we want to update for a feature class that we have in ArcGIS server and that have published from ArcGIS server into AGOL. ...
0
votes
0answers
116 views

SQL Server - ESPG:4326 data stored in Geometry column

It seems that the Microsoft SQL Server Geography data type is better suited for lat/lon because Geography "stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates." ...
0
votes
0answers
14 views

Determining the next checkpoint in a route

I have three tables in SQL Server: (1) Checkpoints, (2)Roads, and (3) Shipments The Shipment has attributes for (1) last visited checkpoint, (2) next checkpoint to visit, and (3) destination ...
2
votes
1answer
48 views

Query MSSQL geography data type against a bounding box

I'm currently storing geographic locations as data type geography in my MSSQL database and performing radius queries against it without issue. Is it possible to query against it using a polygon ...
0
votes
0answers
19 views

QGIS MSSQL attribute table appears filtered when it isn't

EDIT: The MSSQL server version is 12.0.4522, the datatypes used are Geometry. I am not sure if it is topologically valid. I originally had the same issue described and solved here, Spatialite view ...
4
votes
0answers
188 views

When does WKT orientation matter for polygon and multipolygon in geography spatial (left/right hand rule, counter-clockwise, clockwise)

I've decide to use sql server on Azure for my gis database. I'll be dealing with spatial Geography not Geometry. While inserting some country boundaries using the spatial data in SQL Server, some ...
0
votes
0answers
41 views

GeoServer Sql Server Stored Prc

I'm sorry this might be duplicate. I'm trying to call stored proc with sql server. I saw this question which says its not possible but its a 5 yr old question and thought I'd check if there have been ...
3
votes
0answers
70 views

Using SQL intersect query?

I am trying to find the length of a polyline inside a polygon using this query: declare @p geometry, @l geometry; select @l = SHAPE FROM [Vz_DSM_Stationing].[dbo].[Route_Sections] where OBJECTID = 3;...
2
votes
1answer
92 views

Native JAI is false in geoserver

Below given is screen shot of GeoServer 2.13.0 installed on my machine. Configuration of my machine is : Intel(R) Core(TM) i7-3770 CPU @3.40 GHZ Installed Memory 16.0 GB OS Windows 10 64-bit I am ...
0
votes
0answers
335 views

How to Cast geometry to Geography in SQL script in MS SQL Server?

I have a Table with some spatial Data in MS SQL Server. The datatype of the spatial column is geometry. I'm trying to get the closest data from an input file using the following query: DECLARE @g ...
1
vote
1answer
35 views

Why are short integer fields on SDE auto-updating to Precision 5?

I am having a perceived small issue in Server for ArcGIS (10.3.1 and 10.4.1 on SQL Server) where whenever a Short Integer field is added to a feature class, the Precision auto-updates to Precision: 5 ...
0
votes
0answers
34 views

Create square around a point in SQL Server 2016

I have just started working in SQL Server spatial functions. I have a table in SQL Server that stores Latitude,Longitude. I want to create a rectangle of 500 square foot around every point ( that ...
0
votes
1answer
57 views

Not able to parse Latitude & longitude to ogr_geometry

I have a table (Table1) of locations with Latitude and Longitude values. Loc_Nm || geocode_latitude || geocode_longitude A || 43.43044 || -80.0910793 W || 43.9114523 || ...
0
votes
0answers
48 views

Why might Definition Query return empty table?

I am trying to apply a definition query to an AVL table (on an enterprise geodatabase - Microsoft SQL Server 2016) that returns the most recent record for each vehicle in the table. After a little ...
2
votes
1answer
22 views

Why does the SRID of an ogr2ogr-imported MSSQLSpatial table change when using UID/PWD vs. trusted_connection?

I'm using python to run ogr2ogr commands to load SHP to MSSQLSpatial. The command works fine when using trusted_connection, but when I use UID and PWD, the SRID is randomly changed to SRID:846 (while ...
0
votes
2answers
29 views

Add column to show intersection with another layer

I have a table containing a list of properties. I have a successful query to return only those that intersect another layer. However i want to return all the properties now and instead return a new ...
1
vote
2answers
53 views

Comparing Object Fields to a couple million rows with a SearchCursor from arcpy

I'm new to GIS. I'm using arcpy.da.SearchCursor to read from a SQL server, and when I read through the first table I create objects ~350,000 of them. cursor = arcpy.da.SearchCursor(...
0
votes
0answers
18 views

Extracting Shapefile from sql [duplicate]

is there any tools apart from OSGeo that allows to exract shapefile from sql ? Because i had an issue with OSGeo and i am looking for alternatives.
0
votes
1answer
192 views

Downloading the Geoserver SQL Server Extension

I have successfully installed GeoServer on a 64 bit Windows Server and would like to install the Geoserver SQL Server Extension so that I can hook GeoServer up to SQL Server 2017. The GeoServer ...
0
votes
2answers
454 views

Export spatial data from SQL Server to ESRI shapefile

I want to export spatial data from SQL Server to ESRI shapefile and I have an issue : ogr2ogr -f "ESRI Shapefile" " C:\Users\sqlexport.shp " "MSSQL:server=PORT_7FMW8H2;database=testdbspatial;...
0
votes
0answers
265 views

Importing geometry/geography data into Postgresql with PostGIS from SQL Server

I have a csv file that originally came from SQL Server and the geometry/geography data is already in geography format, for example one of the points is: ...
0
votes
0answers
50 views

Feature Layer Information not showing in SQL table

I have a layer in ArcMap to which data is added via my platform. When the data is added I can see the added feature information by either right clicking on the layer open in arcmap and opening the ...
0
votes
0answers
64 views

Get enclosing radius/polygon of SQL spatial query

Is it possible in SQL to run a query of spatial data, and then just return a single polygon, or a radius, that encloses all of the spatial data that was in that query?