locked
SQL SERVER 2000 RRS feed

  • Question

  • Hi,

    I'm trying to create this table in sql server 2000 but I'm getting an error can any body help me out.

    CREATE TABLE [gosalesdw].[ProductComments](

    [ProductID] [int] NOT NULL,

    [Comment] [varchar](255) NULL,

    CONSTRAINT [PK_ProductComments] PRIMARY KEY CLUSTERED

    (

    [ProductID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_

    DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON

    [PRIMARY]

    ) ON [PRIMARY]

     

    :error that i'm getting is

    Server: Msg 170, Level 15, State 1, Line 7

    Line 7: Incorrect syntax near '('.

    Friday, July 9, 2010 3:43 PM

Answers

  • Schemas are new to SQL Server 2005. Try the following:

    CREATE TABLE [ProductComments](
    
    [ProductID] [int] NOT NULL,
    
    [Comment] [varchar](255) NULL,
    
    CONSTRAINT [PK_ProductComments] PRIMARY KEY CLUSTERED
    
    (
    
    [ProductID] ASC
    
    ) ON [PRIMARY]
    
    ) ON [PRIMARY]
    
    

    Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
    Friday, July 9, 2010 4:01 PM
  • If you are connected as gosalesdw user and issue CREATE TABLE , in SQL Server 2000  you do not specify user ownes the object.if gosalesdw is not a member of the sysadmin fixed server role but is a member only of the db_owner fixed database role and creates a table T1, T1 belongs to gosalesdw  and is qualified as gosalesdw .T1. The table belongs to gosalesdw because he did not qualify the table as dbo.T1.

     


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Sunday, July 11, 2010 6:48 AM

All replies

  • Schemas are new to SQL Server 2005. Try the following:

    CREATE TABLE [ProductComments](
    
    [ProductID] [int] NOT NULL,
    
    [Comment] [varchar](255) NULL,
    
    CONSTRAINT [PK_ProductComments] PRIMARY KEY CLUSTERED
    
    (
    
    [ProductID] ASC
    
    ) ON [PRIMARY]
    
    ) ON [PRIMARY]
    
    

    Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
    Friday, July 9, 2010 4:01 PM
  • If you are connected as gosalesdw user and issue CREATE TABLE , in SQL Server 2000  you do not specify user ownes the object.if gosalesdw is not a member of the sysadmin fixed server role but is a member only of the db_owner fixed database role and creates a table T1, T1 belongs to gosalesdw  and is qualified as gosalesdw .T1. The table belongs to gosalesdw because he did not qualify the table as dbo.T1.

     


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Sunday, July 11, 2010 6:48 AM