SqlConnection question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

how can I test if a specific table on an SQL- Server (that I'm connected to) exists or not

Thank
Sam
 
If you're already connected to a specific database you can use the
following query to determine if the table exists.

SELECT table_name FROM INFORMATION_SCHEMA.TABLES
WHERE table_type = 'BASE TABLE'

The other choice for table_type is 'VIEW'.

--Mary
 

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

Back
Top