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 2005 Forums
 SQL Server Administration (2005)
 Data import from one databse to other.

Author  Topic 

kkm
Starting Member

15 Posts

Posted - 2008-10-09 : 10:39:03
Hi,
I have two databases Wisetrack (with complete data and which is linked to wisetrack front end) and WistrackHW. Wisetrackhw is copy of Wisetrack database with out any data
I am trying to import the data from dbo.locations table of Wisetrack database to dbo.locations table of WisetrackHW. The locations table has a foreign key from the users table. In the locations table of WisetrackHW database I changed the property of the foreign key: Enforce Foreign key constraint to NO .Still I am getting the following error:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK__LOCATION__SUPERV__2B5F6B28". The conflict occurred in database "WiseTrackHW", table "dbo.USERS", column 'USER_NAME'

I need help please

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-09 : 10:43:34
It means you are trrying to insert records for which there are no users in the new database.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

kkm
Starting Member

15 Posts

Posted - 2008-10-09 : 10:47:18
Yes . In fact I can only import users after I import locations . that is why I am importing locations first.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-09 : 10:51:57
That's not what the error message is saying.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

kkm
Starting Member

15 Posts

Posted - 2008-10-09 : 11:02:05
Yes you are right. There are no users in the users table
Go to Top of Page
   

- Advertisement -