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.