One of the tables in my database has three columns.
They are dt_id
(PK), dt_name
(varchar) and u_id
(FK).
dt_id
is a identity column.
But I want to have so that dt_name
can only be once per user.
So you can only put in " dt_name='CC', u_id=1 " once.
How can I set the dt_name
column so ?
----Edit:----
Sorry, i will explain better..
dt_it is just a id on the table. dt_name is the value field u_id is the id on a user.
I want to be able to add dt_name unique on each user, so u_id=1 could have value 'CreditCard' only once. But u_id=2 could also have it, but only once..
Hope this clears it up a little.. I'm using MSSQL