Generate Unique ID
-
I'm tryin to create a unique id for each row in the database(SQL SERVER), I don't want to use the standard convention of uniqueidentifer. but to create my own which takes an abbreviation say 'pm' adds the year '06' and finally adds the next row number in sequence. eg. id = 'pm' + '06' + '0001' Has anyone any ideas of how to do this. I have something working but it's not entirely correct. gfhg
-
I'm tryin to create a unique id for each row in the database(SQL SERVER), I don't want to use the standard convention of uniqueidentifer. but to create my own which takes an abbreviation say 'pm' adds the year '06' and finally adds the next row number in sequence. eg. id = 'pm' + '06' + '0001' Has anyone any ideas of how to do this. I have something working but it's not entirely correct. gfhg
You could use a combination key, of, say: 1. PK_ID int IDENTITY (1, 1) NOT NULL 2. Abbreviation_of_whatever varchar(10) NOT NULL 3. Year int NOT NULL :~ Farhan Noor Qureshi if (this == this) thow this;