Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Germany
    Posts
    8

    Question Unanswered: Primary Key in table variable

    hello,

    i want to create a table variable that has a primary key that contains more than one column.
    In the example below the key should include prodID,catID to be unique


    declare @t_CNETPickList table (
    prodID varchar(16) primary key ,
    catid char(2),
    AtrID char(6),
    AtrText varchar(255),
    number int ,
    text varchar(255)
    )

    Is this possible?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    declare @t_CNETPickList table (
    prodID varchar(16) ,
    catid char(2),
    AtrID char(6),
    AtrText varchar(255),
    number int ,
    text varchar(255)

    , primary key ( prodID,catID )

    )


    rudy
    http://r937.com/

  3. #3
    Join Date
    Dec 2003
    Location
    Germany
    Posts
    8
    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •