테이블 존재 확인하기

by kay posted Sep 09, 2013
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

테이블 존재 유무를 확인하는 방법입니다.


CREATE TABLE [dbo].[aaa](
	[aaa] [varchar](255) NULL
)

if exists(select * from information_schema.tables where table_name='aaa') 
BEGIN
	DROP TABLE aaa
	select N'있어서 지웠습니다'
END
else
BEGIN
	select N'없다'
END 

Articles

1 2 3