February 15, 2017 at 5:06 am
TITLE: SQL Server Import and Export Wizard
------------------------------
Error 0xc002f210: Preparation SQL Task 1: Executing the query "TRUNCATE TABLE [dbo].[Counties]
" failed with the following error: "Cannot truncate table 'dbo.Counties' because it is being referenced by a FOREIGN KEY constraint.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
------------------------------
BUTTONS:
OK
------------------------------
February 15, 2017 at 5:19 am
what is it you're after?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
February 15, 2017 at 6:23 am
Where there is a FK constraint, you must DELETE FROM instead of TRUNCATE.
February 15, 2017 at 6:57 am
Or drop the constraint first and recreate it afterwards
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply