SQL删除所有表数据
摘要:
use xxx -- 数据库名DECLARE tables_cursor CURSOR FOR SELECT name FROM sysobjects WHERE type = 'U' OPEN tables_cursor DECLARE @tablename sysname FETCH NEXT FROM tables_cursor INTO @tablename WHILE (@@FETCH_STATUS <> -1) BEGIN EXEC ('TRUNCATE TABLE ' + @tablename) FETCH NEXT FROM tabl 阅读全文
posted @ 2013-04-22 11:19 AndyCai 阅读(173) 评论(0) 推荐(0) 编辑