Question

After connecting to a SQL Server 2008 R2 database using LocalDB (SQL Server 2012), now I cannot connect from SQL Server 2008 R2:

The database 'Northwind' cannot be opened because it is version 706. This server supports version 663 and earlier. A downgrade path is not supported.

Apparently LocalDB performed an auto-upgrade.

Is there a connection string parameter that disables auto-upgrades?

Was it helpful?

Solution

No, SQL Server always performs an upgrade when attaching a database with lower format version. In order to avoid the upgrade you would have to use LocalDB from SQL Server 2008 R2, which doesn't exist, since LocalDB was introduced in SQL Sever 2012.

Update 1

To provide a complete answer: In theory you could attach the database as read-only, which should prevent it from being upgraded (I'm not 100% sure, need to test and verify that). Obviously there are at least two big problems with that. First, the database is read-only, meaning not very useful in most cases. Second, I don't think there is any connection string property that would force AttachDbFileName to attach the database as read-only. You would need to attach it explicitly through T-SQL script, which may defeat the purpose, if the goal is simplicity.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top