SQL Server truncate table - drop and recreate FK constraints script
问题 I'm writing small application (in c#) which helps me to truncate tables in SQL Server 2005/08. In order to truncate table I think I need to do this: drop all FK constraints from table, truncate the table, recreate all previously deleted constraints. Can someone help me to create such a script, or point me where I can find some clues? Regards 回答1: Well, you could do this from your application: run a SQL command on your existing database to find all foreign key constraints from that list of