I've got a SQL Server table(that I created using Enterprise Manager).
I've not played with this much, but I want to have a secondary key on my table, and can't find an option where to do it.
Does this mean each table can only have 1 unique key ?
Printable View
I've got a SQL Server table(that I created using Enterprise Manager).
I've not played with this much, but I want to have a secondary key on my table, and can't find an option where to do it.
Does this mean each table can only have 1 unique key ?
Select 2 columns (using control) then press the "key" symbol. Now the combination of both fields ,ust be unique
I want a secondary key, not a composite key.
You can have only one Primary (unique) key per table, but you can add an Unique Index on the table that will force unique values per row for that column:
Code:CREATE UNIQUE INDEX myIndexName
ON myTableName (myColumnName)
UNIQUE constraints are implemented by an ALTERNATE INDEX on the table.
But they force UNIQUE values in those columns.
If you do not want that, then just CREATE alternate indexes.
Like this:
Code:CREATE INDEX AKClaim on Claim_T (MasId,FirstDate,BeneType)
CREATE INDEX AKClaim2 on Claim_T (AdjDate,Processor,ClaimSeq)
CREATE INDEX AKClaim3 on Claim_T (PostDate,Processor,ClaimEntry)
CREATE INDEX AKClaim4 on Claim_T (ClaimEntry)
CREATE INDEX AKClaim5 on Claim_T (ReversalDate)
CREATE INDEX AKClaim6 on Claim_T (CheckNum)
TheBionicOrange, how have you created the SQL Server Table using Enterprise Manager? Need Help