0

In SQL Server 2012 Management Studio, is there a way to to parse my SQL as SQL Server 2005 syntax? My development PC has SQL Server 2012 Express but the production server uses 2005. I have to hook into a 2005 development server to run my tests before pushing to production.

It would be really nice if I could test for SQL Server 2005 correctness from a 2012 server

1 Answer 1

1

use Compatibility Level.

For 2005, use COMPATIBILITY_LEVEL 90

ALTER DATABASE database_name   
SET COMPATIBILITY_LEVEL = 90

refer to here for more information https://msdn.microsoft.com/en-us/library/bb510680.aspx

Sign up to request clarification or add additional context in comments.

3 Comments

Is there a way to do this temporarily inside the current script/transaction?
no. this is a one-off command. You can create a database and set it to 90 for your testing before deployment.
It's a pity there's no way to run an ad-hoc test for 2005 syntax

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.