Re: Unique Columns

Tech-Archive recommends: Fix windows errors by optimizing your registry



Excel User wrote:
Hi,

I'm coming from an Access background but do not know how do this is
in an SQL DB.

The SQL has an ID (Identity) but would also like to have another
unique column emailaddress what should this be.

Thanks

Same as Access: create a unique index on the column. The following shows a
suggested naming convention for indexes but you certainly don't need to
follow it:

CREATE UNIQUE INDEX IX_tablename_columnname_U
ON tablename (columnname asc)

Look up the CREATE INDEX topic in SQL Books OnLine (BOL) for more
information.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Unique Columns
    ... right clicked on the field and selected Indexes/Keys ... The SQL has an ID but would also like to have another ... CREATE UNIQUE INDEX IX_tablename_columnname_U ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Unique Columns
    ... With SQL Server, writing and running a sql script IS the manual way to ... create a unique index on the column. ... This email account is my spam trap so ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL Update: How do I get more error information
    ... // Write it back to the database - if it was changed ... , (SQL ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: SQL Update: How do I get more error information
    ... "Bob Barrows" wrote: ... , (SQL ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: Multi-step OLE DB operation generated errors
    ... I think the reason it hasn't solved is that this database has the ... Doesinterbaseprovide a trace tool like MS SQL Server's Profiler? ... Please reply to the newsgroup. ... This email account is my spam trap so ...
    (microsoft.public.data.ado)