Top 5 Recent Articles
- Biography (1)
- Blog (26)
- Changes (1)
- Customers (1)
- Education (2)
- General Software (21)
- Image Catalog (2)
- Licensing (1)
- ManifoldGIS (3)
- MySQL Spatial (2)
- Networking and Routing (including Optimization) (3)
- Oracle Spatial (57)
- PostGIS (20)
- Press Releases (1)
- Source code (6)
- Space Curves (1)
- Spatial DB comparison (1)
- SQL (1)
- SQL Server Blog (13)
- SQL Server Spatial (General) (15)
- SQL Server Spatial (LRS) (37)
- Stored Procedure (2)
- XML (5)
Tip #1: SQL Server 2008 “Katmai” – Setting SRIDs
Using FME 2008 Beta I loaded a shapefile containing Local Government Areas in Tasmania into SQL Server 2008 “Katmai”. The shapefile didn’t have a .PRJ and I forgot to set the SRID in FME.
So, without reloading the shapefile how can I change the SRID?
Firstly, open the Microsoft SQL Server Management Studio, open the database and click on the “New Query” button.
To see what the loaded SRID was I can do this:
select distinct a.geom.STSrid from dbo.TAS_LGA a;
The returned result is 0.
Now to set a SRID of 28355 is dead easy. Use the same property method STSrid in an update statement:
update dbo.tas_lga set geom.STSrid = 28355;
Note that in SQL Server all references to OGC 1.1 functions and operators are case-sensitive so make sure you type STSrid and not STSRID. Also since the SRID is a property of the object we don’t need round brackets on the property ie STSrid() would be incorrect.