composite primary key...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheIntern
    New Member
    • Oct 2006
    • 4

    composite primary key...

    I have two fields in a table,first name and last name.Both the fields contain duplicate values.Say, there are two people with the firstname mary.their last names are andrews and mathews.SQL Server wouldn't let me assign these fields a composite primary key.gives me an error saying that the first name field contains duplicate values (Duh...).....
    Any help would be appreciated.
  • Arkhels
    New Member
    • Oct 2006
    • 4

    #2
    No le creaste algun indice?, podrias poner el DDL para ver la tabla, ya sea desde el enterprise manager, seleccionando la tabla, click derecho, Todas las tareas, generar sql script.

    Comment

    • TheIntern
      New Member
      • Oct 2006
      • 4

      #3
      Originally posted by Arkhels
      No le creaste algun indice?, podrias poner el DDL para ver la tabla, ya sea desde el enterprise manager, seleccionando la tabla, click derecho, Todas las tareas, generar sql script.

      ??????????????? ??:(

      Comment

      • scripto
        New Member
        • Oct 2006
        • 143

        #4
        Originally posted by TheIntern
        I have two fields in a table,first name and last name.Both the fields contain duplicate values.Say, there are two people with the firstname mary.their last names are andrews and mathews.SQL Server wouldn't let me assign these fields a composite primary key.gives me an error saying that the first name field contains duplicate values (Duh...).....
        Any help would be appreciated.

        making these fields a composite primary key is not too smart. Add an ID field - data type int identity (1,1) not null.

        Comment

        Working...