I have two SQL servers onr is staging (SQL2005) the other is production (SQL2000). I have a primary key with constraints on a table and I script out the Create for the primary key with constraints. I run the generated T-SQL script on the staging (SQL2005) and it works great. No probs so far. Now I cut and paste the same generate T-SQL script into my production (SQL2000) server and I get this error...
Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '('.
Now this is the same exact cut/paste of the script that ran perfectly fine on my SQL2005 server. So I copied it agan from production (SQL2000) and pasted it into staging (SQL2005) and it works.
Here's the script...
ALTER TABLE [dbo].[fovecComments] ADD CONSTRAINT [PK_fovecContacts] PRIMARY KEY CLUSTERED
([iUserId] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
This kind of error is common when migration a schema to an older version of a database (in your case from SQL 2005 back to SQL 2000). The problem is that the older version does not support all of the features of the newer version.
There are database engines that will simply ignore the features that they don't support and allow you to figure out later if those features were important or not... This is one of my HUGE pet peeves, and I don't think that SQL Server has ever exhibited that particular behavior!