Top 5 Recent Articles
- Blog (15)
- Changes (1)
- Education (2)
- General Software (17)
- Image Catalog (2)
- Licensing (1)
- ManifoldGIS (2)
- MySQL Spatial (2)
- Networking (1)
- Optimized Routing (1)
- Oracle Spatial (20)
- PostGIS (8)
- Source code (5)
- Space Curves (1)
- SQL (1)
- SQL Server Blog (6)
- SQL Server Spatial (General) (12)
- SQL Server Spatial (LRS) (37)
- Stored Procedure (2)
- XML (4)
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.