Microsoft SQL Server is a relational database server product by Microsoft. Its primary query languages are T-SQL and ANSI SQL.

learn more… | top users | synonyms (1)

2
votes
1answer
188 views

SQL Error: Latitude values must be between -90 and 90 degrees

I'm more of an ArcGIS user than a SQL Server user but I have polygon data in a 'geography' type in SQL 2008 R2. For a couple of these poly layers, I get this persistent drawing error in ArcMap: ...
0
votes
1answer
138 views

MS SQL table with geometry field to feature class

I have a table in a native SQL database (no geodatabase, dc_geobank_public.sde in the code) with cca. 300 000 records and 18 fields. Two of the field contains projected X and Y coordinates, and one ...
3
votes
1answer
449 views

SQL Server UNion of geography feature returns FULLGLOBE result?

I have some trouble with sql server 2012. I store coordinates of french cities in my database as geography object (with ESRI 4326) and i want to make the UNION of some cities. I have in result ...
5
votes
2answers
916 views

How can we generate GeoJSON from SQL data with latlong

Is there any way we can create GeoJSON from SQL server table with Latitude & Longitude Data?
1
vote
2answers
48 views

Using Python to select records by date field

I am trying to write a python script to select records created within the past 7 hours (date field - database time) using a where-clause within arcpy. The table is ArcSDE database (Microsoft SQL ...
3
votes
2answers
1k views

Can I fix 'qodbc3:unable to execute statement' when querying SQL Server 2008?

I was testing features of QGIS and its really cool.I tried to query each table using right click and query but I can't query sql server 2008 database : Error: An error occured when executing the ...
5
votes
2answers
857 views

Does a high number of SDE_state_lineages slow performance?

In our SDE database, the SDE_state_lineages table has around 200,000 records, the SDE_states has around 900, and our SDE_versions table has around 1,300 records. We've been having performance issues ...
2
votes
0answers
24 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 ...
1
vote
1answer
894 views

Importing Census TIGER Shape Files to SQL Server 2012?

I've been doing my research on how to import shape files into Microsoft SQL Server 2012. and am still unable to figure out how to do it after hours of playing around with it. I'll document what I've ...
0
votes
1answer
40 views

Copying database view into an enterprise geodatabase?

Say I have DatabaseA, which isn't structured in a way that allows me to reference it as a geodatabase in ArcGIS. Fields have to be renamed, geometry added, etc. etc. Now, it seems to me that what I ...
1
vote
1answer
2k views

Plotting Multiple Points on Google Map using VB.net

I am creating a database application using VB.net and MSSQL 2012. I have retrieved a list of customer from the database and want to plot them on google map. At it stands, I can only plot the first ...
1
vote
0answers
31 views

Some point features in feature class not displaying in ArcMap?

I am trying to display a point feature class, but a few features from the same data set are not displayed. Originally I have heaps of point features in a point feature class, which are well displayed ...
3
votes
1answer
1k views

Creating Stored Procedure in versioned SDE_SQLServer geodatabase using DDL?

I've almost used SQL server_SDE geodatabases for 3 years in GIS projects and I don't know how can I create a stored procedure in geodatabase.I use ESRI case tool to create a geodatabase in ...
9
votes
3answers
6k views

Is it possible to reproject spatial data using SQL Server?

SQL Server takes an SRID when creating spatial data, but is it possible to retrieve an object as a different spheroid? For example, let's say I have a bunch of spatial polygons using SRID 4258, but ...
0
votes
0answers
28 views

Show polygon geometry from SQL Server on Google Maps

I have downloaded Canadian Postal FSA's boundaries (Like Zip boundaries in the USA) from stats Canada and I have imported the shape files in SQL Server. I want to be able to Query the Database and ...
4
votes
1answer
262 views

Populate X and Y fields in SDE Point Data Using SQL trigger

Here is my situation. I am running ESRI ArcGIS Server and Desktop 10.2 on SQL Server 2008 R2. I would like to populate the Latitude and Longitude fields from point data (Signs data collected using ...
2
votes
1answer
512 views

Adding SQL Trigger to update field on INSERT (multiple rows)

I have an address point Feature Class that has an addressID field. I am trying to write a trigger that will in effect auto increment this field when a new address is added to the map. I cannot alter ...
1
vote
1answer
190 views

How to convert MapXtreme FeatureGeometry to something writable to sql server geometry type

I'm new in MapXtreme and I'm bit lost. I have polygon in MapXtreme 7.0 (in C#) saved as FeatureGeometry type. I need to save this in SqlServer 2008 as geometry type, but I don't have direct access to ...
0
votes
1answer
825 views

SQL Geometry Query similar to Select by Centroid

Does anyone know if it's possible to query SQL geometry by something like 'centroid of polygon'...similar to ArcMap's select by location? I'm using SQL Server 2008 R2 as the DBMS. I have two polygon ...
12
votes
3answers
25k views

Create a geography/geometry column from x and y fields - SQL Server 2008

I'm new in SQL Server 2008 and I hope you will understand my question/need. Thus, I have a table which contains 3 fields (Name, Lat and Long) in my data base (spatial). I want to create a ...
2
votes
2answers
155 views

Can't import certain tables from SQL Server to QGIS

This is a list of 193 zip codes and their geometries that do not import in QGIS. This is a list of 999 Census Block Groups and their geometries that do import in QGIS. This is the Add MSSQL Layer ...
3
votes
1answer
41 views

Mapping SQL tables in ArcGIS Desktop

I have several tables in SQL server. I am trying to visualize my data in ArcGIS. However, I have not been able to do so. I started off my making a database connection in Arc Catalog to my SQL. I did ...
1
vote
0answers
30 views

How to parameterize query sent with arcpy.ArcSDESQLExecute class

I have been developing a geoprocessor which takes user inputs as strings to develop a dynamic sql statment sent to MSSS from an ArcSDESQLExecute class. The app will only allow for controlled input, ...
2
votes
1answer
171 views

Connecting to MSSQL 2008 R2 with QGIS 2.0.1

There have been questions related to this, but some of them seem out of date or no one has asked. I'm trying to connect to SQL Server 2008R2 using a MSSQL connection in QGIS. I'm not exactly sure if ...
1
vote
1answer
515 views

How to edit feature in sqlserver geodatabase

I am using arcmap 10.2.1 and arcobject 10.2.1,I just want to conncet to a geodatabase and edit,add,delete a feature from a feature class using arcobject,I tried to connect to database and it works ...
5
votes
2answers
881 views

Load and display a layer from SQL Server using PyQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
1
vote
1answer
766 views

Not able to register spatial view with sde

I am using 10.2 ArcGIS and SOL Server 2008 R2. I have created a cross database spatial view in sql server using following syntax: USE [pipelines] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON ...
1
vote
1answer
263 views

Using M 'Measure' value in SQL Server 2008

MS Sql Server 2008 geometry type supports adding Z and M values to geometry objects, including linestrings. However, I cannot find any way to make use of these values, since methods such as ...
0
votes
0answers
21 views

Can updates be made to “ogr_fdw” foreign tables in PostgreSQL?

I am accessing a Microsoft SQL Server table (w/ SQL Server a geometry column) via an ogr_fdw foreign table. SELECT statements work great, including the PostGIS functions that I've tried. Are UPDATES ...
0
votes
0answers
34 views

Z and M values get lost when extending MS SQL geography Linestring by .STUnion

I'm trying to add new geography points with Z and M values to a geography linestring. This has to be SQL 2008 R2 compatible. I've found some references to .STUnion() and tried that. The linestrings ...
1
vote
1answer
372 views

ArcGIS 10.1 SDE database schema other than SDE or DBO

Just wondering if it's possible to apply a schema other than SDE or DBO to SDE feature or raster tables stored in an enterprise database on MS SQL Server 2008 R2. I have got a new customise schema ...
0
votes
0answers
42 views

Convert XY to Lat Long using SQL?

My organization is creating a 311 mobile app. The backend is all run through SQL and report emails are generated. We are grabbing the xy from the app and then want to translate it to Lat/Long to be ...
0
votes
0answers
65 views

Failure to access the DBMS server, communication link failure

I am using ArcGIS suite 10.2 and have SSMS 2012 installed. I have a database connection through ArcSDE to a SQL database. After roughly 15mins, I am unable to add data from this database. Has anyone ...
4
votes
1answer
99 views

STIntersection returning NULL with seemingly valid geography data

I want to include only the portion of Alaska that's in the western hemisphere. Apparently, some islands are on the other side of the international dateline. I am using STIntersection to intersect the ...
0
votes
0answers
19 views

Automatically picking up OBJECTID in ArcMap from Create View in SQL Server

I have a plain SQL table stored in an SDE database on SQL Server 2008 as below. CREATE TABLE [dbo].[AAA_TEST]( [ID] [int] NOT NULL, [LON] [decimal](9, 6) NOT NULL, [LAT] [decimal](9, 6) ...
2
votes
1answer
918 views

SQL Server 2008 Distance and Performance Problem

I had been working on PostGIS to do some geographic processes and due to some reasons, I had to start to use SQL Server 2008. I ported same code for SQL Server but performance is almost dying when I ...
2
votes
0answers
31 views

QGIS MSSQL Spatial Layer Instant Crash

I am able to connect to the mssql server database and choose the table that contains the spatial data. However, as soon as the layer is added, I get the 'crash dumped' error with a message saying ...
4
votes
1answer
499 views

Problem viewing SQL 2008 “Date” field

I am using ArcMap Basic 10.1 SP1 and I'm connected to a permitting database stored in a SQL Server 2008 R2 database. I am trying to pull the tabular data over into my ArcGIS Desktop Project so that I ...
0
votes
0answers
19 views

How to find Nearest point on line from a point cordinate in SQL server

I want to find out the nearest point on my road network which is a multiline string from a point with lat lon value. The below code I have tried for finding buffer distance line from a point. ...
0
votes
0answers
14 views

How to Find Source and target using STBuffer And STIntersects in SQL Server?

I am using this query to find the source and target from Routes table, but it's not getting the correct result SELECT TOP 1 a.target FROM Routes a WHERE ...
0
votes
0answers
38 views

ArcGIS Desktop 10.3.1 Database locks

I am having difficulties with locks in my MSSQL Databases. I am trying to rename sde featureclasses and also import new ones. Although I have stopped all AGS Services I cannot seem to do simple ...
1
vote
1answer
46 views

Viewing list of data sets that have been edited under specific ArcSDE Version?

I'm wondering if it's possible to list all of the data sets (feature classes, tables, etc.) that have been edited under a particular version in ArcSDE. A tool that does this would be ideal (I see ...
0
votes
0answers
20 views

While connecting MS SQL getting error “Data source name not found and no default driver specified QODBC3: Unable to connect”

I have used the following code for connecting the Microsoft SQL Server's database. but at the time of opening database connection it is throwing an error. Here is my code, from PyQt4.QtGui import * ...
5
votes
1answer
2k views

Reset Object ID After Truncating Table In SQL Server

I am working on a program to export data from a view containing a geometry type in Sql Server 2008, to an ArcSDE table on another server which also stores data using the geometry type. The source ...
1
vote
1answer
65 views

Should the QGIS “DB Manager” have Microsoft SQL Server as an option?

I was looking for interactive query options for SQL Server (similar to SQL Server Management Studio). The "DB Manager" works great for Postgres and I'm primarily using the Load as new layer as I build ...
4
votes
1answer
60 views

How to automate joining SQL Server non-spatial database tables to ArcGIS shapefile

I have dozens of SQL Server non-spatial database tables. These are common tables, the column types are: nvarchar, int and float. I try to use Arcpy to automate joining these database tables to ...
0
votes
0answers
15 views

SQL Server aggregate function in ogr2ogr command

I would like to define create a GeoJSON bounding box using SQL Server's EnvelopeAggregate function, embedded in an ogr2ogr command. I have the following command: ogr2ogr -f GeoJSON envelope.json ...
2
votes
2answers
429 views

SQL Server STRelate equivalent of Oracles SDO_RELATE(…mask=anyinteract)

In Oracle Spatial, we are running checks on a graph. The Check should provide Nodes, which are marked as endnodes (Attribute "EDGEDEGREE" equals 1) but are in fact located somewhere along an edge. We ...
0
votes
0answers
25 views

Need to find a point a given distance along a linestring

Need to take a linestring and find a coord every x meters along the line. I tried using the SQL Server Spatial Tools and found .NET to be slow and after 5(ish) days of processing, SQL server (or .NET) ...
0
votes
2answers
61 views

Downloading entire OSM world dataset and import into MS SQL

I am trying to download the entire dataset of OSM and placing into a MS SQL Database. Does anyone have any ideas of how to go about that?