|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
PrimaryKey and uniquehow can I design a table to get unique values in a column within the PK
columns? Example: Client (int, PK) User (int, PK Userid(char...) userid's shoud be unique for a client. Other clients are allowed to have same userid's as other clients. A second user of a client cannot have the same userid as other user of this client. thanks for any help. Looks like you have it almost right:
alter table MyTable add constraint PK_MyTable primary key (ClientID, UserID) -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Michael Haberichter" <Haberichter@community.nospam> wrote in message how can I design a table to get unique values in a column within the PKnews:ED15E772-0327-4C98-8FBD-92AE3717D1FB@microsoft.com... columns? Example: Client (int, PK) User (int, PK Userid(char...) userid's shoud be unique for a client. Other clients are allowed to have same userid's as other clients. A second user of a client cannot have the same userid as other user of this client. thanks for any help.
Other interesting topics
Parse a character seperated list of items
The Data Miner: SQL Server Data Mining Newsletter (March 2006) SQL Server Management Studio error on connection New Query with Current Connection Memory allocation in MS-SQL 2000 instances SQL Management Studio 2005 how do I view a database transaction log? Hidden max number of columns in Management Studio? bug: "autostat" of an index reported by SQL Server Management Studio for 2005 SQL Management Studio 2005 |
|||||||||||||||||||||||