Checking existance of sql tables and folders

A

Andy B

How do you check to see if a certain folder exists? I also need to know how
to check for the existance of a certain sql server database table.
 
J

JDS

Andy,

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx

Your second question seems to me so ridicilous that you probably can better
explain us where you need that to give you a proper answers.

Cor



- Hide quoted text -

- Show quoted text -

Steady on Cor! There may be good reason. I'm a relative newbie and
would be very disheartened to be told my question was ridiculous.

Andy: the following SQL might help:
SELECT COUNT (*) FROM sys.objects WHERE name = 'MyTableName' AND type
= 'U'

There may be better ways to do this but hope this helps.

Jeremy.
 
A

Armin Zingler

Andy B said:
How do you check to see if a certain folder exists? I also need to
know how to check for the existance of a certain sql server database
table.

Have a look at the Connection's GetSchema method and it's documentation.


Armin
 
C

Cor Ligthert [MVP]

JDS.

Do I have the right to find something ridicoulous, or is it only to newbies
to say what they want?

I know a reason to check if a table already exist and then still I would not
use it (anymore)

So I am curious why it is done.

Cor

"JDS" <[email protected]> schreef in bericht
"Andy B" <[email protected]> schreef in
berichtHow do you check
to see if a certain folder exists? I also need to know

Andy,

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx

Your second question seems to me so ridicilous that you probably can
better
explain us where you need that to give you a proper answers.

Cor



- Hide quoted text -

- Show quoted text -

Steady on Cor! There may be good reason. I'm a relative newbie and
would be very disheartened to be told my question was ridiculous.

Andy: the following SQL might help:
SELECT COUNT (*) FROM sys.objects WHERE name = 'MyTableName' AND type
= 'U'

There may be better ways to do this but hope this helps.

Jeremy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top