Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / July 2005

Tip: Looking for answers? Try searching our database.

Unique Index error upsizing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark A. Sam - 26 Jul 2005 23:05 GMT
Hello,

I am trying to upsize a table from Access to SQL Server and get this
message:

CREATE UNIQUE INDEX PHONE ON Contacts(PHONE)

Server Error 1505: CREATE UNIQUE INDEX terminated because a duplicate key
was found for index ID 5. Most significant primary key is '<NULL>'.
Server Error 3621: The statement has been terminated.

Phone is a unique key, but not a primary key.  I tried removing the key,
upsizing then adding the key from an Access project, but it wouldn't let me.

Thanks for any help and God bless,

Mark A. Sam
Tom Moreau - 26 Jul 2005 23:08 GMT
You have multiple rows with Phone = NULL.  If you still want to index this
and accommodate the duplicate NULLs, the add the following indexed view
instead:

create view dbo.PhoneView
with schemabinding
as
select
   PHONE
from
   dbo.Contacts
where
   PHONE is not NULL
go

create unique clustered index idx_Phone on dbo.PhoneView (PHONE)
go

Signature

  Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON   Canada
www.pinpub.com
.

Hello,

I am trying to upsize a table from Access to SQL Server and get this
message:

CREATE UNIQUE INDEX PHONE ON Contacts(PHONE)

Server Error 1505: CREATE UNIQUE INDEX terminated because a duplicate key
was found for index ID 5. Most significant primary key is '<NULL>'.
Server Error 3621: The statement has been terminated.

Phone is a unique key, but not a primary key.  I tried removing the key,
upsizing then adding the key from an Access project, but it wouldn't let me.

Thanks for any help and God bless,

Mark A. Sam
Mark A. Sam - 27 Jul 2005 14:24 GMT
Thanks Tom, you were right about the Nulls.  I don't know what you mean by
adding the view below, but I put in values where they were Null and was able
to upsize the table.

God Bless,

Mark

> You have multiple rows with Phone = NULL.  If you still want to index this
> and accommodate the duplicate NULLs, the add the following indexed view
[quoted text clipped - 31 lines]
>
> Mark A. Sam
 
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



©2008 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.