반응형
/********************************************************************************************
-- Title : [2k5] 프로시저 그룹화
-- Reference : blog.naver.com/danbee99
-- Key word : 프로시저 그룹화 procedure grouping
********************************************************************************************/
-- 이걸 대체 어떻게 어디다 쓰라꼬...ㅡ.ㅡ''''''
drop table ttt;
-- Title : [2k5] 프로시저 그룹화
-- Reference : blog.naver.com/danbee99
-- Key word : 프로시저 그룹화 procedure grouping
********************************************************************************************/
-- 이걸 대체 어떻게 어디다 쓰라꼬...ㅡ.ㅡ''''''
drop table ttt;
create table ttt
(a int not null identity
, b int
);
(a int not null identity
, b int
);
insert into ttt values (9);
insert into ttt values (9);
insert into ttt values (9);
insert into ttt values (9);
insert into ttt values (9);
select * from ttt;
go
go
create proc up_ttt;1
as
select * from ttt where a = 1;
go
as
select * from ttt where a = 1;
go
create proc up_ttt;2
as
select * from ttt where a = 2;
go
as
select * from ttt where a = 2;
go
exec up_ttt;1;
exec up_ttt;2;
go
exec up_ttt;2;
go
select * from sys.procedures;
/*
name object_id
------ ---------
up_ttt 149575571
*/
go
/*
name object_id
------ ---------
up_ttt 149575571
*/
go
sp_helptext 'up_ttt';
/*
create proc up_ttt;1
as
select * from ttt where a = 1;
create proc up_ttt;2
as
select * from ttt where a = 2;
*/
go
/*
create proc up_ttt;1
as
select * from ttt where a = 1;
create proc up_ttt;2
as
select * from ttt where a = 2;
*/
go
drop proc up_ttt;
go
go
반응형