1

I wrote a lot of scripts for SQL Server 2005, but now I have to rewrite those original scripts to make them work on SQL Server 2000.

I don't remember all the differences between 2005 and 2000. For instance, CTE was announced only in 2005 - and I must rewrite these queries to work on SQL Server 2000.

I need a way to check the syntax, while not having SQL Server 2000 at hand. Setting the compatibility level to 80 does not solve the issue - I get no warning, no errors.

Is there a tool to use for cheking the syntax of the scripts? Can it be done with SSMS 2008?

1 Answer 1

1

You need to open a connection to the SQL Server 2000 database where you would execute the commands.

Then you set the parse only in the connection and "execute" the command. It will not get exceuted, but, if there's any syntax problem, it will throw the corredponding errors.

It's important to do it in th e database where you'd exceute the commands, as they depend on the database objects (existing table names, for example).

Here you have the information about this SET option:

SET PARSEONLY

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

6 Comments

Good option. But the problem is that SQL Server 2000 is not available. So having SQL Server 2008 R2, I need to check syntax without actual deploy.
You can install a SQL Server Express 2000 and use it for this prupose.
No such thing as SQL Server 2000 Express. Maybe you meant MSDE? bing.com/search?q=download+msde+2000 ... If you go this route, PLEASE make sure you apply Service Pack 4. The last thing you want is to open yourself up to the slammer worm.
Yes, you're completley right. I meant MSDE. I didn't remember the name (and architecture and installation) change at this moment. Besides there's now a new version available which includes fixes for slammer: microsoft.com/download/en/details.aspx?id=22661
I'm a total loser. I have Win7 x64. MSDE is not compatible with this version of windows. :)
|

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.