Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 DTS, Primary Key Error

Author  Topic 

Pace
Constraint Violating Yak Guru

264 Posts

Posted - 2005-03-31 : 02:44:38
Hi all I have a script which creates a database for me, it create's a table named 'Job' which has 'JobNo' as a primary key and various default values.

Once I have the structure I have a DTS package that copies data from an Access database to my SQL one.

Originally one of the fields was failing due to the fact it was more than 255 characters so I converted that filed to text but now when I run the script I get the following error:



Has anyone had this problem before and knows of a solution, or can anyone see that im not doing something quite how I should. Im really baffled

Obviously I have checked the Access database to see if it has a primary key on another field but this just doesnt seem to be the case.


when life hands you lemons, ask for tequila and salt

jason
Posting Yak Master

164 Posts

Posted - 2005-03-31 : 16:14:44
quote:
Obviously I have checked the Access database to see if it has a primary key on another field but this just doesnt seem to be the case.



Are you saying the Access db does or does not have a primary key defined on the 'JobNo' column?
Go to Top of Page

Pace
Constraint Violating Yak Guru

264 Posts

Posted - 2005-04-01 : 04:16:39
It does,

its ok I got round it in the end, had to learn all about pivot tables on the way in excel

The error was due to duplicate values in the JobNo field, hence it will not allow that to be a primary key.

when life hands you lemons, ask for tequila and salt
Go to Top of Page
   

- Advertisement -