摘要:
--构造测试数据: 只作演示用CREATE TABLE [dbo].[Tim_LinqTable]([Id] int PRIMARY KEY IDENTITY(1,1) NOT NULL,[Name] [varchar](50) NOT NULL,[Parent] int NOT NULL,)GOINSERT INTO [Tim_LinqTable] SELECT 'A',0 UNION ALLSELECT 'A1',1 UNION ALLSELECT 'A2',1 UNION ALLSELECT 'B1',2 UNION ALL 阅读全文
摘要:
打开Sql server management studio并新建一个查询,在打开的XXX.SQL文件中输入:execsp_MSforeachtable @command1='Delete from ?'execsp_MSforeachtable @command1 = "TRUNCATE TABLE ?"然后执行语句。------------------------------------------------------------------------------------------如果由于外键约束删除table失败,则先删除所有约束:--/第 阅读全文