Hi All,
I need to truncate a table. I have disabled all the constaints using this script.
SELECT 'ALTER TABLE ' +
QUOTENAME( c.TABLE_NAME ) +
' NOCHECK CONSTRAINT ' +
QUOTENAME( c.CONSTRAINT_NAME ) AS ALTER_SCRIPT
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS c
WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
I ran the alter table script. Still I'm getting the same violation of foreign constraint error. Can someone tell me what I'm doing wrong here?
Thks!