G Guest Apr 18, 2004 #1 Hi how can I test if a specific table on an SQL- Server (that I'm connected to) exists or not Thank Sam
Hi how can I test if a specific table on an SQL- Server (that I'm connected to) exists or not Thank Sam
M Mary Chipman Apr 18, 2004 #2 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
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
V Val Mazur Apr 22, 2004 #3 Hi Sam, You could query system tables. but if you want to be generic, then use OpenSchema method if ADO or GetOledbSchemaTable method if ADO.NET http://support.microsoft.com/default.aspx?scid=kb;en-us;309488
Hi Sam, You could query system tables. but if you want to be generic, then use OpenSchema method if ADO or GetOledbSchemaTable method if ADO.NET http://support.microsoft.com/default.aspx?scid=kb;en-us;309488