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.

196 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
1k 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 ...
4
votes
0answers
380 views

QGIS 2.10.1 & SQL Server 2014

I'm struggling to load spatial data into QGIS from SQL Server 2014. I have a table with 4 geography columns (3 are polygon layers, one is a point layer). The table has a primary key column that is a ...
4
votes
0answers
194 views

SQL Server, Given a linestring with M value, what is the location of this other M value

We are investigating migrating a prototype into SQL Server (azure). We have LineStrings that also have M values. What we would like to do is given another M value find out what its geographical ...
4
votes
0answers
194 views

New SQL Monitor Showing Database Deadlocks, Should I be alarmed?

We recently installed a SQL Monitoring tool that is raising High Alerts for SQL Server Deadlocks on my SDE database at random times during the day. Using the information provided in the Alert I have ...
4
votes
0answers
275 views

Spatial Precision for Editing in Multiple GIS Clients

I have something I'd like to discuss, I'll try to explain it first, why it's important, and I'll explain how ArcGIS handles the issue, which I think is a good way to handle it. Finally I'd like to ...
4
votes
0answers
867 views

Geoserver WMST Date Format

There is table in SQL-Server 2008 R2. In this table I have date column with date format like this 2006-09-08 14:39:41.000. Now I make a view from this table on GeoServer side and do nothing with the ...
4
votes
0answers
2k views

Ogr2ogr: Unable to open datasource problem

I downloaded the Precints shapefile from the City of Boston's data hub, and I'm trying import it into SQLServer (I'm running the Express verson). I've already created the database in the SQLServer (...
3
votes
2answers
278 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 ...
3
votes
0answers
130 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;...
3
votes
0answers
60 views

Loading layer from ArcSDE for SQL Server Database using PyQGIS?

I am use this code to load a layer from ArcSDE SQL Server database, but it only loads a table. uri = QgsDataSourceURI() uri.setConnection("localhost","", "arcsde", "sa", "****") uri.setDataSource('...
3
votes
0answers
96 views

Rename the output file ArcGIS

I am copying a tons of features from a file geodatabase to a database server. First I created an enterprise geodatabase connenction and after a database connection. In the first step I added a ...
3
votes
0answers
386 views

Problem with adding non spatial view from MSSQL to QGIS

I have QGIS 2.12.3 app installed on one server (servername1) and MSSQL server database installed on servername2. The database is password protected and I have made connection successfully using QGIS ...
3
votes
0answers
297 views

GDAL MSSQL with numeric table names

I have many SHP tables organised by year, for example 2015_xx_data.shp that I have loaded into a MS SQL Server database using OGR2OGR. I have also loaded them into MySQL for a comparison. There are no ...
3
votes
0answers
47 views

Shoehorning hierarchial data into ArcSDE for MS SQL Server?

I've been tasked with creating a set of tables to store hierarchical data within an ArcSDE. This is in reference to utility data, i.e, a set of valves, control panels, actuators, etc (each ...
3
votes
0answers
777 views

ArcGIS 10.1 & SQL Server 2012

We currently updated to SQL Server 2012 and now we are encountering a slower performance when connecting to the geodatabase on SQL Server 2012. Here are the things that we tried to fix the issue: - ...
3
votes
0answers
1k views

How to get WKT from SHAPE column in the ArcSDE geodatabase?

I have an ArcSDE geodatabase running on top of SQL Server 2008. A table for a feature layer was added from ArcCatalog. The SHAPE column is a type of int which was automatically converted from ...
3
votes
0answers
1k views

Use MS SQL Server to convert MGRS to Lat Long

Below is the SQL for converting Military Grid Reference System (MGRS) to decimal Latitude and Longitude. It is very accurate, but not perfect. If you can make it work 100%, it is yours, but PLEASE ...
2
votes
0answers
63 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. ...
2
votes
1answer
92 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 ...
2
votes
0answers
81 views

Running ogr2ogr script batchfile from SQL fails due to temporary drive mapping

I am trying to run the SQL procedure EXEC xp_CMDShell 'blahblah.bat' which needs to run an ogr2ogr script to create a kml from sql. The batch file works if I run it alone but with SQL permissions it ...
2
votes
0answers
26 views

arcpy.ArcSDESQLExecute with UPDATE and OUTPUT

Is there a way to get OUTPUT through arcpy.ArcSDESQLExecute? Whatever I do I get only True. When running UPDATE through MS SQL Server Management Studio I get OBJECTID of all updated features (rows): ...
2
votes
0answers
168 views

T-SQL Invalid Geometry Created by Intersection

I have two sets of geometries (A and B) in SQL Server 2016. I want to determine the overlap areas of those geometries from set A that intersect set B. Most of the time this code works: SELECT a....
2
votes
0answers
116 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 ...
2
votes
0answers
517 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 ...
2
votes
0answers
248 views

SQL geography::EnvelopeAggregate output not accurate

I am trying to get the geography::EnvelopeAggregate for a set of locations. The geography column values are calculated using the Lat/Long for individual points. When I try to fetch the boundary box(...
2
votes
0answers
81 views

QGIS2.14: Attribute table values show “error” while Identify show results

Using QGIS2.14 and using source data from a MSSQL Server 2016 instance I stumbled across a strange error. My attribute table show all values as "ERROR"-values while using Identify shows up attribute ...
2
votes
1answer
90 views

Transfer real time data from SQL server to ESRI ArcGIS without using PI Integrator?

I am new to GIS. Right now I am working on my senior project in which I have to find the fault in transmission line and show its location on a map using ARCGIS 10.2. I have some readings of voltage ...
2
votes
0answers
930 views

SQL Server 2014 Failure to access the DBMS server 08S01

After upgrading our esri sde database from SQL Server 2008 to 2014 I am experiencing issues when overwriting some of our larger datasets. After some amount of time the overwriting process abruptly ...
2
votes
0answers
100 views

MS SQL Layer - Losing LineStrings (Polyline) from SQL Server to QGIS

I have a table called [gfts].[Shapes] which contains a primary key shape_id and a geography data type GEOM. When I query the table in SQL Server I get the following Spatial Results: However, when I ...
2
votes
0answers
189 views

point in multiple polygons

I have a point (lat/lng) and a collection of geofences (polygons / circles / rectangles) Simply put, I want to know if the point is inside ANY of the geofences, it's not important which one. I know ...
2
votes
0answers
287 views

ERROR 1: Error initializing the metadata tables :

I use ogr2ogr (bundled with QGIS 2.14.3) on Windows to convert an ArcSDE MS SQL Server 2012 database with SQL Geometry to PostGIS (2.1.8). I use the following syntax: ogr2ogr --config ...
2
votes
0answers
1k views

Export SQL Server to Shapefile with OGR, difference between 2014 and 2012

I'm trying to export some data from a SQL Server table to a shapefile. I have tested this on a 2014 SQL Sever and it works but when I try and run it on a 2012 SQL Server it creates a blank output. ...
2
votes
0answers
96 views

Improve performance of a stand-alone table join in a Feature Service

I have an mxd with data-driven pages using Feature Layers from ArcGIS for Server (Workgroup Standard) with MS SQL Server Express. The DDP index layer has a join to a stand-alone table. I am ...
2
votes
0answers
374 views

Connecting QGIS 2.14.3 to SQL 2012 both on LocalHost or Remote

I am working on establishing MSSQL (2012) spatial connection from my QGIS 2.14.3, its giving me an error like: (Error opening connection: [Microsoft][SQL Server Native Client 11.0]Named Pipes ...
2
votes
0answers
92 views

Asp.net or MsSql Create bbox of a point proportional to image height and width

Short question is how do I create bbox dimensions that is proportional to image height and width? I'm working on a asp.net webservice to generate a map using geoserver. The parameters I have are ...
2
votes
0answers
349 views

How to properly deal with rectangles being curved on geographies?

I'm using Microsoft SQL Server to store simple data for administrative boundaries of the world (lots of polygons). I store this in a geography data type column. Afterwards I query these polygons by a ...
2
votes
0answers
429 views

Best SRID for worldwide data in Microsoft Sql Server geometry field?

I'm using Microsoft Sql Server 2012 to store geographical data related to hydrometeorological stations which are scattered around the globe (point layers and multipolygon layers). My data is in WGS84 ...
2
votes
0answers
916 views

QGIS Connection with MSSQL localdb not possible correctly

I installed MSSql Server Express with localDB. Everything looks ok. The connection with the LocalDB is nessesary and the tables and views are displayed in the QGIS MSSQL Dioalog. A primary key is ...
2
votes
0answers
1k views

ArcGIS server 10.1 REST API queries fail inconsistently

I have a set of map and ESRI feature services running on a 10.1 ArcGIS server with SQL Server back end. When I query the layers for either the geometry or oids using the REST interface, the query only ...
2
votes
0answers
107 views

SQL server in ArcGIS 10.2 Desktop

I am using ArcGIS 10.2, and previously using Oracle spatial as back end. Now the data providers have shifted to SQL providing core data using FTP which is being staged at SQL server. We need to ...
2
votes
0answers
597 views

Is there a way to eliminate duplicate 'point clusters' in SQL Server 2008 r2 spatial?

I am using the ST.Distance function to identify clusters of geometry data points. Each point has a unique reference number associated with it. I would like to eliminate duplicate clusters from the ...
2
votes
0answers
941 views

How to populate the geometry_columns table

I have a SQL Server table of vector data (containing latitude, longitude, UComp and VComp columns), that I am trying to add as a layer to QGIS. Here is a sample of the data in the SQL Server data ...
2
votes
0answers
730 views

Import GML data in SQL Server Spatial

I have GML file with Application Schema whose data I need to import into SQL Server Spatial. I have been creted database structure with all thing that I need in database, and now I need to fill it ...
2
votes
0answers
229 views

Convert Arcpy results to feature class in ArcMap 10.1

I am using ArcGIS 10.1 and am a newbie in Python. Currently we are executing stored procedure (from sql server) through ArcPy in ArcMap. I want to create feature class from executing following python ...
2
votes
0answers
931 views

Bulk insert into MS SQL Creating ObjectID's

I am running an ETL from a spatial view into publication database. The view has results in duplicate ObjectID's. I started working with the get_ids SP example from ESRI, but that seems to be built ...
2
votes
0answers
218 views

Working with WKT data in XML File in SQL Server

Anyone have experience with importing XML files into SQL server 2008 or 2012 that have a WKT element that includes the geometry for each feature? I can get this to easily work using FME software but ...
2
votes
0answers
315 views

Refreshing MSSQL Layer in QGIS

When working on a map in QGIS I will often set up a view in my SQL Server spatial database and create a MSSQL layer based on this. As part of my workflow I often make adjustments to the SQL view ...
2
votes
0answers
266 views

Find Nearby GPS Navigation Route

I am developing a car pooling website. For that, I have created the database which has the different route options selected by different user. These routes are saved in the Database as Geography ...
2
votes
0answers
516 views

How do I use ReorientObject() in an SQL Server 2012 UPDATE statement?

I'm trying to UPDATE a Geography field in an SQL Server 2012 database using the output of a web mapper. I got the dreaded "The specified input does not represent a valid geography instance because it ...
2
votes
0answers
326 views

Issues importing feature class to SDE SQL Server 2012

I have received an error indicating there could be issues with my geometry when attempting to import a feature class into SDE. I ran the check geometry tool. No issues. I have removed all fields ...