Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Data Only to From Production to Test

Status
Not open for further replies.

ousoonerjoe

Programmer
Jun 12, 2007
925
US
Using SQL Server 2005.

I've been trying to copy all data from all tables from our Production database to our Testing database. When I use the Import/Export Wizard, it pukes on the tables with Primary Keys. The options are set as stated below:

Optimize for many tables = Checked
Run in a Transaction = Checked

Edit Mappings
Drop and recreate new destination tables = UNchecked
Delete Rows in existing destination tables = Checked
Enable Identity Insert = True

What am I missing?

Error Statement Returned:

ERROR : errorCode=-1071636471 description=SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "The statement has been terminated.".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'PK_AbsentCode'. Cannot insert duplicate key in object 'dbo.AbsentCodes'.".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}


--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
UPDATE:

Completely irritated. The global 'Edit Mappings' settings are pointless. When I set each table individually, everything works as expected.

GRrrrrrr

--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top