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
 
Back
Top