随笔分类 - SQL基础知识
批量删除表
摘要:BEGINDECLARE @tableName varchar(100);DECLARE test_curse CURSOR FAST_FORWARD FORselect name from sysobjects where type='u' and name like 'R%'OPEN test_...
阅读全文
摘要:--sql server 数表:select count(1) from sysobjects where xtype='U'--数视图:select count(1) from sysobjects where xtype='V'--数存储过程select count(1) from sysobj...
阅读全文
摘要:DECLARE @tableName AS Nvarchar(50)--查询表名条件(小心!,确保like条件是你要Drop的表.TableName尽量精确) SET @tableName='IC_' --SELECT name FROM sys.tables WHERE name LIKE '%'+@tableName+'%' --查询出要删除表的名称 IF @tableName='' SET @tableName='tableName'--初始化TableName为tableName,防止@tableName为
阅读全文

浙公网安备 33010602011771号