Re: EXISTS

From: Andreas Mosmann <mosmann_at_expires-31-01-2009.news-group.org>
Date: Wed, 28 Jan 2009 18:31:44 +0100
Message-ID: <1233163904.07_at_user.newsoffice.de>



Michel Cadot schrieb am 28.01.2009 in
<49808224$0$24227$426a74cc_at_news.free.fr>:

> "Wilfrid" <grille11_at_yahoo.com> a écrit dans le message de news: > 49807732$0$10060$426a74cc_at_news.free.fr...

>| IF OBJECT_ID('tablename') is null
>| CREATE TABLE tablename
>| (
>| id int not null,
>| name nvarchar(10) null
>| )
>| go
>|
>| Thanks in advance for your help
>|
>|

> Check if it is in user_tables

that means something like
select

        count(*) COUNT_OF_TABLES
from

	user_tables UT
	--ALL_TABLES A
where
	UT.TABLE_NAME=&MyTable
	--A.TABLE_NAME=&MyTable
	--and
	--A.OWNER=&MySchema

COUNT_OF_TABLES is 0 or 1

I do not know whether you want to do it manually, by any script language or if you want to write a GUI for that, but if you use one of that queries you will find out what you want.

also try out
SELECT * FROM DICTIONARY WHERE upper(COMMENTS) like '%TABLE%' to find out more

> Regards
> Michel
HTH
Andreas

-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Wed Jan 28 2009 - 11:31:44 CST

Original text of this message