tags:

views:

14

answers:

0

We have a SQL Server 2008 database that has recently been updated to use the geography (spatial) type. We use SQLMetal to generate our DAL (LINQ entities) and since the type upgrade, this now fails to produce a .cs file due to a missing type error which causes SQLMetal to abandon the process.

Is there a workaround (other the removing the spatial types!) that would allow us to continue to use SQLMetal? I was hoping .NET 4.0 might supply a new version but there doesn't seem to be one.

At the moment, we're creating a separate (empty) database WITHOUT the spatial types in order to run SQLMetal successfully. The irony here is that we don't use the spatial columns at all in code so we really don't care if SQLMetal didn't include them!

Edit: Just as a bit of extra information, we found that it was stored procedures (using spatial types) that caused SQLMetal to abort. Tables containing the types were simply skipped. As we're using LINQ predominantly in our DAL and the stored procedures were called in an offline manner, we've removed the "/sprocs" switch from our SQLMetal invocation - that has provided us with a solution that suits us. It would be nice if Microsoft updated SQLMetal though to work with it's OWN (apparently "flagship") software.

related questions