Re: Unique Columns



Bob,

Thanks for your reply, is it possible you to let me know. Instead of using the script you wrote, I'm trying to understand by manually doing this first.

If created a field called testuniquefield in my table,
right clicked on the field and selected Indexes/Keys
Add
Selected from Columns 'testuniquefield'
Selected 'Yes' to 'Is Unique'

Is this the way?

Thanks

"Bob Barrows" <reb01501@xxxxxxxxxxxxxxx> wrote in message news:#OLvLXs5JHA.1092@xxxxxxxxxxxxxxxxxxxxxxx
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
    ... 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: Unique Columns
    ... I'm coming from an Access background but do not know how do this is ... The SQL has an ID but would also like to have another ... create a unique index on the column. ... This email account is my spam trap so I ...
    (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)

Loading