March 12, 2012 at 12:57 pm
Ok guys, I'm a student, new to sql and really need help. How do u auto generate your primary key? I'm my case its 'event Id' note old sql. Think its 2003
March 12, 2012 at 1:11 pm
No such thing as SQL 2003.
There are many ways to generate artificial primary keys (keys that have no meaning within the data), there's also the option not to use an artificial primary keys but rather choose one of the candidate keys from the data as the primary key.
Can you be a little clearer what you're asking?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 12, 2012 at 1:19 pm
Ok they have asked us to create a database which I have and now I need to create a table. They ask for event I'd to be unique and then ask for it to be auto generated
March 12, 2012 at 1:23 pm
dilakshan31 (3/12/2012)
Ok they have asked us to create a database which I have and now I need to create a table. They ask for event I'd to be unique and then ask for it to be auto generated
Who is this "they" you are talking about?
March 12, 2012 at 1:25 pm
Can you be more specific?
What is the requirements for the EventID? What's it going to be used for? (if nothing, why do 'they' care about how it's generated)?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 12, 2012 at 1:31 pm
Its part of my project I have. I have no clue on how to do this
March 12, 2012 at 1:40 pm
Without clearer explanations, we're not likely to have a clue either. Have you asked the teacher/lecturer?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 12, 2012 at 1:50 pm
That's all they ask me to do. Event I'd is an attribute in table. Which will be primary key. And now needs to be auto generated
March 12, 2012 at 1:52 pm
Would still like to know who this "they" is.
Look up identity columns in Books Online.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply