标签:style blog io color ar sp div on log
CREATE PROCEDURE select_all AS BEGIN SELECT * from T_login1 END GO
CREATE PROCEDURE select_name @id uniqueidentifier AS BEGIN SELECT * from T_login1 where PSN0001A=@id END GO
alter proc proc_findStudentByName @name nvarchar(10)=‘F%‘ as select * from T_login1 where PSN0001A like @name go exec proc_findStudentByName ‘F%‘
create proc sele_name @name nvarchar(10)=‘hong3‘ as select * from T_login1 where PSN0002A=@name exec sele_name ‘lk‘ exec sele_name
create proc [dbo].[p_selectName] @name nvarchar(10), @num int output as select @num=COUNT(PSN0001A) from T_login1 where PSN0002A=@name declare @num int exec p_selectName ‘lk‘,@num output print @num declare @num1 int exec p_selectName @name=‘lk‘,@num=@num1 output print @num1
create proc #p_selectName2 as select COUNT(PSN0001A) from T_login1 where PSN0002A=‘lk‘ exec #p_selectName2
alter proc #p_selectName2 as select COUNT(PSN0001A) from T_login1 where PSN0002A=‘lk‘ exec sele_name exec #p_selectName2
if (object_id(‘proc_temp‘, ‘P‘) is not null) drop proc proc_temp1--如果存在不为空,释放掉 go create proc proc_temp1 with recompile as select * from T_login1 go exec proc_temp1;
if (object_id(‘proc_temp_encryption‘, ‘P‘) is not null) drop proc proc_temp_encryption go create proc proc_temp_encryption with encryption as select * from T_login1; go exec proc_temp_encryption; exec sp_helptext ‘proc_temp1‘; exec sp_helptext ‘proc_temp_encryption‘;
标签:style blog io color ar sp div on log
原文地址:http://www.cnblogs.com/hongmaju/p/4088938.html