What Type System Version (Compatibility Level) token can I specify in ADO.NET connection string to indicate that only SQL Server 2012 is supported?
1 Answers
According to this it will be "SQL Server 2012". While the page is for the .NET framework 4.5 and thus still pre release, given the other possible values for the parameter, it is safe to assume that this value will stand.
Having that said, I don't know if any .NET version below 4.5 will even accept that value as valid. I'm not at a computer right now, so I cannot check, sorry.
EDIT It looks as if this value is indeed parsed/checked on the client side, i.e. inside System.Data
. Looking with Reflector, it happens in SqlConnectionString.SqlConnectionString(string connectionString)
. Also, there is an enumeration SqlConnectionString.TypeSystem
which names all the known/supported values. For .NET 4.0 that would be SqlServer2000
, SqlServer2005
, SqlServer2008
and Latest
. This value is the passed around inside the System.Data.SqlClient
classes and ends up being used somewhere inside SqlDataReader
.
So, unless you use Latest
which would use but not force SQL Server 2012, there is no way to force SQL Server 2012 type system with .NET < 4.5.

- 47,778
- 10
- 99
- 143
-
I thought that the token would be parsed on server side, not by the framework, thus is framework version independent. Also it's a new feature of SQL Server 2008. I'm talking this because tried your token before asking in ASP.NET 4 against SQL Server 2012 Dev and it doesn't work! – abatishchev May 07 '12 at 05:26
-
Thanks for your investigation! – abatishchev May 07 '12 at 06:39