34,588
社区成员
发帖
与我相关
我的任务
分享
EXEc sp_MSforeachtable @command1='truncate table ?'
用循環語句送sysobjects中把 tablename 取出,
然後動態拼接 truncate table tablename
sp_MSforeachtable @command1="Delete from ? "
sp_MSforeachtable 'Truncate Table ?'
就这种
--删除当前数据库所有表中的数据
sp_MSforeachtable 'Delete from ?'
sp_MSforeachtable @command1="Delete from ? "
sp_MSforeachtable 'Truncate Table ?'