Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2004, 02:51 PM
Registered User
 
Join Date: Oct 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check for existance of a table

Hi,

I have a sql server with thousands of tables which I would like to link back to an access frontend only when they are required.

Please would someone kindly advise the correct sql to send to the server to check if a user table exists, before the application programme attempts to create a link for the table.

many thanks

Lizu

 
Old June 13th, 2004, 05:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

select * from INFORMATION_SCHEMA.Tables where TABLE_NAME = '<table name>'
 
Old June 14th, 2004, 03:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can also use this.

Code:
SELECTE * FROM sysobjects WHERE NAME = <TABLE_NAME> and TYPE='U'
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 14th, 2004, 04:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

This of course begs the question of what on earth would a database be doing having "...thousands of tables..." in it, and what a user application would be doing not knowing what those tables are.

I'm guessing we have a design here where each table is really a single entity, instead of that entity being a row in just one table...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to check the username already exists in table asad_black ASP.NET 2.0 Basics 2 September 15th, 2008 07:19 AM
check for file existance sentme_mail VB How-To 7 February 22nd, 2005 08:06 AM
How to check alignment of table DorisTan VB How-To 0 December 14th, 2004 11:15 PM
Check Existance of file at Client Side hrishimusale Classic ASP Basics 2 September 9th, 2003 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.