清数据脚本
摘要:假设在数据库中,存在A,B,C三张表,表与表之间通过外键互相关联。如果想要清楚这3张表的数据需要先清楚约束关系,再清空表数据。在实际应用中需要注意,有些表是基础数据表,不能清除。脚本: 1 --USE master 2 --BACKUP DATABASE [YourDB] 3 -- TO DISK = 'H:\YourDB_datetime.bak' 4 --GO 5 6 USE [YourDB] 7 GO 8 9 ALTER TABLE [YourDB].[Table A] NOCHECK constraint all;10 ALTER TABLE [YourDB].[Tab
阅读全文
posted @
2012-09-28 10:47
ca2ju3
阅读(87)
推荐(0)