question

sandeep avatar image
sandeep asked

Error occuring in the given code, will any one help in clearing the error ASAP

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_element_popup_window](
      [e_popup_window_id] [int] IDENTITY(1,1) NOT NULL,
      [e_popup_window_pi_id] [int] NULL,
      [e_popup_window_instance] [int] NULL,
PRIMARY KEY CLUSTERED 
([e_popup_window_id] ASC)
WITH (
PAD_INDEX  = OFF,
STATISTICS_NORECOMPUTE = OFF, 
IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS = ON, 
ALLOW_PAGE_LOCKS = ON, 
FILLFACTOR = 90
     ) 
ON [PRIMARY]
) ON [PRIMARY]
sqlsql-server-2000deprecated
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I tried running the script and it ran fine. Can you post the specific error you're recieving?
0 Likes 0 ·

1 Answer

· Write an Answer
Kev Riley avatar image
Kev Riley answered

I'm guessing (as you don't say what the error actually is) that you have scripted this table from a 2005+ server - this syntax for CREATE TABLE is invalid in SQL 2000.

Specifically it is the WITH clause of the PK constraint - the only WITH clause allowed in SQL 2000 was WITH FILLFACTOR =

See this MSDN link for the correct syntax.

2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Oh nuts. I ran it on 2008. That explains it. Good catch.
1 Like 1 ·
Took me a while to find a SQL2000 to run it on though......
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.