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
相关文档:
1.Stop 所有服务
2.用 Windows Install Clean Up 工具卸载SQL 2005组件
3.用SrvInstw.exe删除所有SQL服务
4.清除注册表
a. 将HKEY_CURRENT_USER---Software----Microsoft下的Microsoft SQL Server文件夹全部删除
b. 将HKEY_LOCAL_mACHINE---SOFTWARE---Microsoft下 ......
sql精妙用法
文章分类:数据库
说明:复制表(只复制结构,源表名:a 新表名:b)
select * into b from a where 1<>1
说明:拷贝表(拷贝数据,源表名:a 目标表名:b)
insert into b(a, b, c) select d,e,f from b;
说明:显示文章、提交人和最后回复时间
select a.title,a.username,b.adddate ......
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 ......
作为一个B/S开发者,或多或少都得和数据库打交道,而对数据库的操作归根到底都是query语句,所有到最后都是为了查询,那么查看sql性能又成了我们开发中的一件趣事。下面简单介绍下sql_trace的使用:
alter session set sql_trace =true ;--打开sql_trace
select * from (select * from t order by id) where rownum <= ......