davice

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年11月26日

摘要: declare @tbname varchar(50),@sql nvarchar(1000) --定义变量@tbname,@sql,@jdeclare tbroy cursor forselect name from sysobjects as awhere xtype= 'u'and SUBSTRING(name,0,3)='PM'order by name --定义游标,sysobjects为系统表,xtype= 'u'表示是用户表open tbroy --填充游标fetch next from tbroy into @tbname --提 阅读全文
posted @ 2011-11-26 11:09 davice 阅读(1410) 评论(0) 推荐(0) 编辑

摘要: sql server 数表:select count(1) from sysobjects where xtype='U'数视图:select count(1) from sysobjects where xtype='V'数存储过程select count(1) from sysobjects where xtype='P'SELECT * FROM sysobjects WHERE (xtype = 'U')C = CHECK 约束 D = 默认值或 DEFAULT 约束 F = FOREIGN KEY 约束 L = 日志 F 阅读全文
posted @ 2011-11-26 11:07 davice 阅读(9489) 评论(0) 推荐(2) 编辑