By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,995 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,995 IT Pros & Developers. It's quick & easy.

Checking existance of sql tables and folders

P: n/a
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.

Jun 27 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"Andy B" <a_*****@sbcglobal.netschreef in bericht
news:%2****************@TK2MSFTNGP03.phx.gbl...
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/libr...ctoryinfo.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
>
Jun 27 '08 #2

P: n/a
JDS
On Jun 26, 5:37*am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
"Andy B" <a_bo...@sbcglobal.netschreef in berichtnews:%2****************@TK2MSFTNGP03.phx.gb l...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/libr...ctoryinfo.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.
Jun 27 '08 #3

P: n/a
"Andy B" <a_*****@sbcglobal.netschrieb
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
Jun 27 '08 #4

P: n/a
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" <ad***@jeremysage.comschreef in bericht
news:da**********************************@m45g2000 hsb.googlegroups.com...
On Jun 26, 5:37 am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
"Andy B" <a_bo...@sbcglobal.netschreef in
berichtnews:%2****************@TK2MSFTNGP03.phx.gb l...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/libr...ctoryinfo.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.
Jun 27 '08 #5

P: n/a
On Wed, 25 Jun 2008 20:04:04 -0400, "Andy B" <a_*****@sbcglobal.netwrote:

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.

In addition to Armin's suggestion you can use a SQL SELECT query as well.

http://forums.microsoft.com/MSDN/Sho...90247&SiteID=1
Paul
~~~~
Microsoft MVP (Visual Basic)
Jun 27 '08 #6

P: n/a
"Andy B" <a_*****@sbcglobal.netschrieb:
How do you check to see if a certain folder exists?
'System.IO.Directory.Exists'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jun 29 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.