Nahum
Nahum

Reputation: 7197

Convert Single SQLSERVER 2005 Script to a SQL SERVER 2000 script

Hi guys first of all I have no expirience with DB programing only basic SQL queries.

I have an sql script that was devolped for SQL Server 2005 FB and I need to run it in SQL server 2000.

I don't have the original 2005 DB. only a script and a SQL 2000DB

I found many guides for converting a whole DB but what can I do with a single script?

it is a very long script that I cannnot share here because of datasecurity issues.

here is the error

enter image description here please assist me.

Upvotes: 1

Views: 821

Answers (1)

Marek Grzenkowicz
Marek Grzenkowicz

Reputation: 17373

The syntax for specifying index options has changed - look closely at the WITH clause:

SQL Server 2000

CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
    ON { table | view } ( column [ ASC | DESC ] [ ,...n ] )
[ WITH < index_option > [ ,...n] ]
[ ON filegroup ]

SQL Server 2005 and later

CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name 
    ON <object> ( column [ ASC | DESC ] [ ,...n ] ) 
    [ INCLUDE ( column_name [ ,...n ] ) ]
    [ WITH ( <relational_index_option> [ ,...n ] ) ]
    [ ON { partition_scheme_name ( column_name ) 
         | filegroup_name 
         | default 
         }
    ]
[ ; ]

The WITH clauses in your script use parentheses  and that causes the error. Unless you know that the script sets some specific index options, you can simply remove all the WITH ( ... ) clauses.

Upvotes: 2

Related Questions