Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bootsy
Starting Member
7 Posts |
Posted - 2008-03-04 : 16:34:17
|
| I created a table with a field called myID. I set the data type as "uniqueidentifier", but it won't auto generate. How do I create a field to auto generate a unique number? I'm working with SQL Server 2000 and I'm creating the table from Enterprise Manager. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-04 : 16:35:44
|
| Why not use an identity column instead?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
jdaman
Constraint Violating Yak Guru
354 Posts |
Posted - 2008-03-04 : 16:36:06
|
| CREATE TABLE TableName ( myID INT IDENTITY(1, 1), ... ) |
 |
|
|
bootsy
Starting Member
7 Posts |
Posted - 2008-03-04 : 16:57:04
|
| That's what I would like to do is create an identity column but I don't know how. Is this done in the properties of the column. I'm so lost.jdaman .. where would I put that statement? |
 |
|
|
bootsy
Starting Member
7 Posts |
Posted - 2008-03-04 : 17:04:54
|
| Thanks guys. I figured it out. I didn't know that the "INT" data type would give me that option. thanks so much. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-04 : 18:23:03
|
Or bigint, tinyint or smallint. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|