use master
go
if object_id('master..sp_search') is not null begin
drop proc sp_search
end
go
create proc sp_search
(
@searchText varchar(100)
, @type int = 0
)
as
if @type <> 1 begin
select a.name
from sysobjects a
where exists
(select *
from syscomments
where a.id = id
and text like '%' + @searchText + '%'
)
and xtype ='P' and category =0
end else begin
select a.name
from sysobjects a
where exists
(select *
from syscomments
where a.id = id
and text like '%' + @searchText + '%'
)
and (xtype ='V') and category =0
end
'연구개발 > SQL2005' 카테고리의 다른 글
로그전달 구축강좌 2/6 - 백업 수행 프로시저, 테이블 생성 (0) | 2009.06.18 |
---|---|
로그전달 구축강좌 1/6 - 임시 DB 생성 및 백업 (0) | 2009.06.18 |
DML 트리거의 사용 (0) | 2009.06.15 |
커서 정보 확인 (0) | 2009.06.12 |
테이블 필드명 변경 (0) | 2009.06.12 |