Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > sql server full text search > october 2007 >

sql server full text search : Newbie question: unique index across nvarchar fields


Rémi
10/26/2007 5:38:00 AM
Surely an easy question for those in the know...

I have a contacts table, and I'd like to ensure uniqueness across
first/middle/last name fields. Each field is an nvarchar(255) - as
such, I can't create a regular index because the combined index size
is greater than 900 bytes. I've briefly looked into Full-Text
indexing, but it seems to me that it's primarily for searching, and I
can't see how I can use it to enforce uniqueness.

Can I setup a full-text index to enforce uniqueness? Do I need to
enforce this constraint in the app instead of the database?

Thanks for any tips.

Remi.
Hilary Cotter
10/26/2007 10:52:10 AM
You could where you would do a check to see if the combination field exists
and if not enter it. You will probably find that plain old non-clustered
indexes will work better here, or even an indexed view. With SQL 2005 use
the include option when creating your indexes.

--
RelevantNoise.com - dedicated to mining blogs for business intelligence.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Rémi
10/28/2007 10:04:47 AM
Thanks for the tip.

Found information on including non-key columns in non-clustered
indexes in books online; methinks this is what I was looking for.

Remi.
AddThis Social Bookmark Button