SQL-查询所有触发器
----查看所有角本
Create table #y (txt text)
select name, iid = identity(int,1,1) into #x from SysObjects where xtype = 'TR'
declare @i int, @max int
declare @name varchar(40)
set @i = 1
select @max = max(iid) from #x
while @i <= @max
begin
select @name = name from #x where iid = @i
insert #y (txt)
exec('sp_helptext ' + @name)
set @i = @i + 1
end
select * from #y
drop table #x
drop table #y
相关文档:
HO~HO~EXCEL生成SQL建表存储过程的VBA脚本^_^赞一下
2007-12-11 10:39
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 全局变量定义
Const MAX_COLUMN_NUM = 50
Dim stOutputPath As String
Dim stOutputFile As String
Dim stDBName As String
Dim stUserName As String
Dim stUserPasswd As ......
最近在找一次sql查询的无限分类查询的设计,网上找了一下这个数据表的设计很有特色,
不用递归,依靠个简单SQL语句就能列出菜单,看看这个数据表怎么设计的,并对下面的数据表结构的查询进行分析.
数据库字段大概如下:
-----------------------------------------------------------------------------------
id ......
语句:select rank() over(Order By 表的主键 Desc) As UID ,其他列 from 表
说明:rank函数
作用:
返回指定元组在指定集中的排名(排名从 1 开始)
Rank(Tuple_Expression, Set_Expression [ ,Numeric Expression ] )
参数:
Tuple_Expression
一个有效的多维表达式 (MDX) 元 ......
declare @dfname varchar(50)
select @dfname=a.name
from sysobjects a
inner join syscomments b on a.id=b.id
inner join sysconstraints  ......