Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Strategies
»
Auto generated primary key
Auto generated primary key
Rate Topic
Display Mode
Topic Options
Author
Message
dilakshan31
dilakshan31
Posted Monday, March 12, 2012 12:57 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, March 12, 2012 1:49 PM
Points: 4,
Visits: 4
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
Post #1265477
GilaMonster
GilaMonster
Posted Monday, March 12, 2012 1:11 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 37,728,
Visits: 29,989
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 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1265492
dilakshan31
dilakshan31
Posted Monday, March 12, 2012 1:19 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, March 12, 2012 1:49 PM
Points: 4,
Visits: 4
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
Post #1265499
Lynn Pettis
Lynn Pettis
Posted Monday, March 12, 2012 1:23 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 7:39 AM
Points: 21,620,
Visits: 27,453
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?
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1265506
GilaMonster
GilaMonster
Posted Monday, March 12, 2012 1:25 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 37,728,
Visits: 29,989
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 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1265509
dilakshan31
dilakshan31
Posted Monday, March 12, 2012 1:31 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, March 12, 2012 1:49 PM
Points: 4,
Visits: 4
Its part of my project I have. I have no clue on how to do this
Post #1265515
GilaMonster
GilaMonster
Posted Monday, March 12, 2012 1:40 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 37,728,
Visits: 29,989
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 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1265523
dilakshan31
dilakshan31
Posted Monday, March 12, 2012 1:50 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, March 12, 2012 1:49 PM
Points: 4,
Visits: 4
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
Post #1265533
Lynn Pettis
Lynn Pettis
Posted Monday, March 12, 2012 1:52 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 7:39 AM
Points: 21,620,
Visits: 27,453
Would still like to know who this "they" is.
Look up identity columns in Books Online.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1265538
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.