Type_name(id)返回指定Id的类型名称,如VarChar,Char,Int等,Id为SysColumns系统表返回的XType列中的值,这个函数在做数据字典和服务器管理程序时很有用!!
Sp_ForEachTable:遍历所有当前库中的表,示例:
Exec Sp_ForEachTable "if not exists(Select 1 From ?) drop table ?" --用来删除库中所有空表
Sp_ForEachTable:遍历所有当前库中的表,示例:
Exec Sp_ForEachTable "if not exists(Select 1 From ?) drop table ?" --用来删除库中所有空表