본문으로 바로가기

MS SQL Text 검색

category Development/MsSql 2008. 10. 30. 20:53
users란 text를 가진 프로지저 또는 테이블을 검색
select object_name(id) from syscomments
where [text] like '%users%'

xtype : 프로시저냐? 테이블이냐?, status : 유형이 사용자면 0이상 시스템이면 0 보다 작다
select * from sysobjects
where xtype = 'P' and status >= 0  
 

 해당 테이블명을 사용한 SP목록 조회

sp_depends [테이블명] 

 

SP 내용 조회

select s.name, o.name
 from sys.objects o
  join sys.schemas s on o.schema_id = s.schema_id
  join syscomments t on t.id = o.object_id
 where t.text like ''%내용%''
 group by s.name, o.name
 order by s.name, o.name

'Development > MsSql' 카테고리의 다른 글

SQL 서버 2005, 그 변화 속으로  (0) 2010.07.27
테이블 수정  (0) 2010.07.21
페이징 쿼리  (0) 2008.10.30
쿼리분석기(Query Analyzer) 단축키  (0) 2008.10.30
BULK INSERT  (0) 2008.10.08