|
-
Oct 17th, 2006, 05:21 PM
#1
Thread Starter
Hyperactive Member
[SQL Server]forcing each value in a column to be unique without making it an identity
I'm using whatever version of SQL Server that comes with VS 05. I think it's 2003. I can't seem to find a way to either make a column an identity but keep it type char and thus not have it increment or make a column accept only values that aren't already in that column. It seems like something someone would want to do pretty often (like if they wanted unique UserID's and Usernames) so there has to be a way to do it, right?
I tried to end process on Visual Studio 2005
but PETA stopped me saying it's smart enough
to be a living creature 
-
Oct 17th, 2006, 05:54 PM
#2
Re: [SQL Server]forcing each value in a column to be unique without making it an identity
Just set it as Unique.
If you want to do it using SQL statements see here. You can also do it easily in the table design within Enterprise Manager (S.S. 2000), and presumably Management Studio (S.S. 2005).
-
Oct 17th, 2006, 08:26 PM
#3
Thread Starter
Hyperactive Member
-
Oct 17th, 2006, 11:52 PM
#4
Thread Starter
Hyperactive Member
Re: [SQL Server]forcing each value in a column to be unique without making it an identity
well that didn't work but I'm redoing a lot of my program because I shouldn't be converting non-unique fields back to their unique primary key ID fields anywhere anyway cuz they should be able to double up :P
I tried to end process on Visual Studio 2005
but PETA stopped me saying it's smart enough
to be a living creature 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|