MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 7th, 2004, 03:21 PM
doctor doctor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 41 doctor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Returning Database Object names

hey everyone, need some help

I have a query return all the names of the table in my database via this code:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left([Name],4))<>"MSYS"));

I need to further refine the search fitting in the critera LIKE 'qry_tbl%' I dont know how to fit this in .. i tried fitting it in to the end, but nothing comes up.. I also tried querying the results of this query with another query :-P but that didnt work either .. any ideas?

In essence i need all the table names in my DB that start with 'qry_tbl' to be in a list for me..

Thx
Doc


This gives me all the names

Reply With Quote
  #2  
Old July 7th, 2004, 06:07 PM
Al_Dev's Avatar
Al_Dev Al_Dev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 105 Al_Dev User rank is Private First Class (20 - 50 Reputation Level)Al_Dev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 32 m 21 sec
Reputation Power: 6
Send a message via AIM to Al_Dev
wildcard is a * in Access, this should work, change the name to your field name

SELECT MSysObjects.Name
FROM MSysObjects
WHERE Left([Name],4)<>"MSYS" and name like "tbl_qry*" ;

hope it helps.

Al

Reply With Quote
  #3  
Old July 8th, 2004, 08:06 AM
doctor doctor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 41 doctor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Awesome Al,

It worked, Just curious.. any idea why the % didnt work? arent they equivalent? I guess not if it didnt but just curious why...

thx

Reply With Quote
  #4  
Old July 8th, 2004, 07:18 PM
Al_Dev's Avatar
Al_Dev Al_Dev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 105 Al_Dev User rank is Private First Class (20 - 50 Reputation Level)Al_Dev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 32 m 21 sec
Reputation Power: 6
Send a message via AIM to Al_Dev
cool. glad it worked.

queries that you write in access are actually odbc calls i believe. and have different syntax for certain things.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Returning Database Object names


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT