摘要: 1.查询指定数据库中所有表名 use YOURDATABASENAME//你的数据库名称 SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'2.清空所有表数据 exec sp_msforeachtable @command1='truncate table ?', @whereand=' and objectproperty(o.id,''TableHasForeignRef'')=0' exec sp_msforeacht 阅读全文
posted @ 2011-07-27 11:34 baby_tao 阅读(199) 评论(0) 推荐(0) 编辑