1

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.

2
  • If you feel you cannot post it here, why not just show us the portions of the code where it fails when you try to run under SQL2000? Commented Mar 29, 2012 at 12:38
  • Probably it will directly work without changes. Or it will not. But if you don't try, and don't show it to us, how could we help you??? Commented Mar 29, 2012 at 12:39

1 Answer 1

2

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.

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

Comments

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.