Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 13th, 2004, 02:51 PM
Registered User
 
Join Date: Oct 2003
Location: Newmarket, Cambridgeshire, United Kingdom.
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

Reply With Quote
  #2 (permalink)  
Old June 13th, 2004, 05:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

select * from INFORMATION_SCHEMA.Tables where TABLE_NAME = '<table name>'
Reply With Quote
  #3 (permalink)  
Old June 14th, 2004, 03:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #4 (permalink)  
Old June 14th, 2004, 04:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.