查看所有表名,查询结果加上字符

查询该实例下所有表名

USE [EmergencyCommand_FT]
GO

SELECT NAME FROM SYSOBJECTS WHERE TYPE='U'

拼上相关字符

SELECT 'truncate table ' +NAME +';' FROM SYSOBJECTS
WHERE TYPE='U'
and name not in ('Customer','Customer_CustomerRole_Mapping','CustomerRole','PermissionRecord','PermissionRecord_CustomerRole_Mapping')

 

posted @ 2018-02-22 14:22  大鵬展翅九万里  阅读(157)  评论(0编辑  收藏  举报