Vadim Loboda
Vadim Loboda

Reputation: 3111

How to check if a SQL script is compatible with sql server 2000

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?

Upvotes: 1

Views: 1535

Answers (1)

JotaBe
JotaBe

Reputation: 39055

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

Upvotes: 1

Related Questions