Checking existance of sql tables and folders

  • Thread starter Thread starter Andy B
  • Start date Start date
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.
 
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.
 
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
 
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.
 
Back
Top