how to trauncate table with foreign key

--

how to truncate table with foriegn key in mssql

step1.
trauncate table [your table name]
it may rise can’t delete data due to foreign key constraints

step2.

alert table [error message’s foreign key constraints table name] nocheck constraint all

delete [you want to delete data table name]

alert table [error message’s foreign key constraints table name] check constraint all

--

--

Jameskrauser Lee

For the last few years. i was involved mostly in the development of Automatic Fare collection system for the Chennai Metro. Familiar with C++ and iOS.