I need to create my own primary key, how do I go about doing that?? In the database I am working in usually has a primary key that looks like this VL0008
the V is for Vendors, thats basically their number. Some of these Vendors need to be licensed and some dont, the ones that are not licensed dont get a number but I am to use that as the Primary/Index key I need to create one for those particual vendors. How can I go about doing that??? I was wanting to make it TL888 something like that.
I'm more than a little confused. A primary key can be any datatype that supports enough unique values for each row of interest to have exactly one value for the primary key. Most of the folks here like to use integers, although everybody is free to use their own preference (distributed apps like GUIDs, most legacy apps seem to like CHAR, whatever works...).
I'd suggest picking the whatever datatype suits you, and simply using it. I would avoid anything that needs specific formatting, these often cause more problems than they solve. Most of the folks here like to use an int with an IDENTITY attribute.
To add a PK value to table BigFatMess, you could use something like:
ALTER TABLE BigFatMess
ADD BigFatMessId INT IDENTITY (-2147483648, 1)
PRIMARY KEY (BigFatMessId)
I think she is looking for a way to auto-generate alphanumeric keys (which could then be used as a primary key...).
You could try creating an incrementing identity field in your table to create the numeric portion and then have a calculated field that prepends your alphabetic string.
But you should think about WHY you want this and WHAT you are going to do with it. Frankly, a code such as "TL888" is not as usefull as two separate columns for storing the "TL" and "888" portions, because as a single value you will need to apply character functions to it to parse out and use its components and you will lose the benefit of indexes.
If it's not practically useful, then it's practically useless.