清空一个数据库中所有数据
2009-08-17 11:22
399 查看
微软不公开的存储过程 ,代码如下:
--Removed CHECK Constraint-------------------------
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' --NOCHECK Constraints
print 'All Constraints Disable'
go
--truncate All tables if trying to empty the database
--- Ensure the T_X_ref database is located on a different database
------------- Truncate All Tables from Model ----------------
-----To limit tables a table with sub model tables must be created and used joins-----
EXEC sp_MSForEachTable 'truncate TABLE ? '
print 'All tables truncated'
go
--Removed CHECK Constraint-------------------------
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' --NOCHECK Constraints
print 'All Constraints Disable'
go
--truncate All tables if trying to empty the database
--- Ensure the T_X_ref database is located on a different database
------------- Truncate All Tables from Model ----------------
-----To limit tables a table with sub model tables must be created and used joins-----
EXEC sp_MSForEachTable 'truncate TABLE ? '
print 'All tables truncated'
go
相关文章推荐
- 清空一个数据库中所有表的数据的sql语句
- 使用SQL语句清空数据库所有表的数据(转)
- 清空数据库中所有表数据的方法(慎用)
- 清空数据库中所有表的数据
- 【数据库-MySql】清空所有表格的所有数据
- 使用SQL语句清空数据库所有表的数据
- Mysql中返回一个数据库的所有表名,列名数据类型备注
- 【Sqlserver清空数据库中所有表数据】
- mysql 怎样清空一个数据库中的所有表
- 使用SQL语句清空数据库所有表的数据
- mysql 怎样清空一个数据库中的所有表
- SQL Server 如何清空数据库所有表数据
- 使用SQL语句清空数据库所有表的数据
- MSSQL清空当前数据库中所有用户表的数据,重置标识列
- 一次性清空某个数据库中所有表数据的SQL
- mysql 怎样清空一个数据库中的所有表
- 一个函数抓取代谢组学权威数据库HMDB的所有表格数据
- 使用SQL语句清空数据库所有表的数据
- SQL2008 清空数据库中所有表数据的方法
- 如何将一个表格的所有数据存到数据库的一个字段里,并如何将这一个数据字段里的数据填充到前端表格里