Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Albania
    Posts
    1

    Unanswered: unique identifier

    How can i get a numer for using it as unique identifier in two related tables?

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Declare @id Integer
    Set @id = 0
    update table
    Set @id = @id + 1, id_column = @id
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Are you specifically looking for an integer value, or are you trying to generate a Unique Identifier data type? A new Unique Identifier value can be generated by calling the NewID() function, either in a procedure or as a default column value.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Sep 2003
    Posts
    522
    why not use identity column property? and then, after insert, you can use scope_identity() function to use for the child table dml.

Posting Permissions

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