Unique ID for a View

  • Hi,

    I have a view which has no unique ID but I need one. The data does not present any data that can be used for a unique id.

    Any ideas?

    Thanks for the help.

    Bill

  • Do you always need a unique value or just for certain situations? Short term you could possibly use a temp table in lieu of the view. Or how bout creating a single column table that contains unique values. Then add that column to the view.

  • How to use a temp table in a view?

  • You can add column with a unique combination of the existing columns or you can use newid() function to have a 25 characters long unique value..

    --Ramesh


  • Thank you all for the replies.

    Situation resolved.

    I was able combine two int fields cast as varchar then cast again as int to use as the unique id.

    Bill

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply