编写存储过程常用技巧汇总
来源:互联网 发布:windows键被锁定 编辑:程序博客网 时间:2024/05/29 15:17
-- 根据存储过程名取存储过程内容
-- 调试 GetContentByProcedureName '[dbo].[CPP_CountOfTrdeByUserID]'
alter procedure GetContentByProcedureName
( @ProcedureName nvarchar ( 500 ))
as
if exists ( select * from dbo.syscomments where id = object_id (N'' + @ProcedureName+ '' ))
select c. text , c.encrypted, c. number , xtype = convert ( nchar ( 2 ), o.xtype),
datalength (c. text ), convert ( varbinary ( 8000 ), c. text ), 0 from dbo.syscomments c, dbo.sysobjects o
where o.id = c.id and c.id = object_id (N'' + @ProcedureName + '' )
order by c. number , c.colid option (robust plan )
alter procedure GetContentByProcedureName
( @ProcedureName nvarchar ( 500 ))
as
if exists ( select * from dbo.syscomments where id = object_id (N'' + @ProcedureName+ '' ))
select c. text , c.encrypted, c. number , xtype = convert ( nchar ( 2 ), o.xtype),
datalength (c. text ), convert ( varbinary ( 8000 ), c. text ), 0 from dbo.syscomments c, dbo.sysobjects o
where o.id = c.id and c.id = object_id (N'' + @ProcedureName + '' )
order by c. number , c.colid option (robust plan )
存储过程总top+变量参数
Alter proc getWorkPlan2
(
@intCounter int
, @lngUserID int
)
as
set rowcount @intCounter
select lngWorkID,strWorkName,strExecHumanName,strBeginDate
from worklist where lngExecHumanID = @lngUserID
order by lngWorkID desc
(
@intCounter int
, @lngUserID int
)
as
set rowcount @intCounter
select lngWorkID,strWorkName,strExecHumanName,strBeginDate
from worklist where lngExecHumanID = @lngUserID
order by lngWorkID desc
- 编写存储过程常用技巧汇总
- sqlserver编写存储过程汇总
- 存储过程常用技巧
- 存储过程常用技巧
- 存储过程常用技巧
- 存储过程常用技巧
- 存储过程常用技巧
- Oracle存储过程编写技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- oracle存储过程常用技巧
- 我的博客YesAha.com
- Centos : centos cannot find a valid baseurl for repo
- Web service
- Android面试应该详细掌握的内容
- 关于ubuntu的apt-get和安装目录
- 编写存储过程常用技巧汇总
- 程序的装入和链接
- Web容器的编码问题
- 树状显示二叉树
- Web容器的编码问题
- C++继承学习笔记
- Web容器的编码问题
- visual studio 2008下装CGAL
- visual studio 2008下装CGAL