Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / June 2009



Tip: Looking for answers? Try searching our database.

Unique Columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Excel User - 06 Jun 2009 17:09 GMT
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
Bob Barrows - 06 Jun 2009 17:42 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> 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.

Signature

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"

Excel User - 06 Jun 2009 22:30 GMT
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

>> Hi,
>>
[quoted text clipped - 15 lines]
> Look up the CREATE INDEX topic in SQL Books OnLine (BOL) for more
> information.
Adrienne Boswell - 07 Jun 2009 02:23 GMT
Please don't top post. Reply moved.

>>> Hi,
>>>
[quoted text clipped - 31 lines]
>
> Thanks

Bob did not write a script, he wrote a SQL query for the job to be
performed.  This is what the program does, it creates a query based on
what you have clicked. It would be better for you to see what the SQL
query is, rather than letting a program do it for you.

You will find this useful when you need to do something that Access's
"wizards" either do not know how to do what you want to do, or they don't
do it correctly.

It's always better to look under the hood.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Bob Barrows - 08 Jun 2009 15:42 GMT
With SQL Server, writing and running a sql script IS the manual way to
accomplish this.

It sounds as if you are trying to use Access to alter the design of the
table. Does it work?

> Bob,
>
[quoted text clipped - 37 lines]
>> I don't check it very often. If you must reply off-line, then remove
>> the "NO SPAM"

Signature

HTH,
Bob Barrows

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.