473,770 Members | 4,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to select all tables in a database?

5 New Member
hi,

if anyone can help me please,

i nead to select all the tables in my database in one instruction. all the tables have the same structure.
the problem is that i dont know the number of tables neighter their names.

i nead a solution like SELECT * from database_name.*

thanks
Oct 20 '10 #1
2 1270
code green
1,726 Recognized Expert Top Contributor
If you don't know your database structure how can you query it?
To SELECT tables makes no sense.
If you want to SELECT data from multiple tables you need JOIN
Oct 21 '10 #2
Ravi L
12 New Member
I dont get exactly what you are trying to do. Below are some suggestions:
List all tables in the database-
Select * from sys.objects where type='u'

Generate Select query for all tables in database-
Select 'Select * from '+name from sys.objects where type='u'

Further to this, clarify exactly what you intend to do.
Oct 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1822
by: Mikko Pulkkinen | last post by:
Hi, I'm trying to use Crystal Reports to generate reports from an Access database. I'm using VS2003 and C#. I need to select the database the report uses as data source at runtime. The database does not have any password protection. I've tried using ODBC connections, but all I get is logon errors. It seems that I should be able to pass a connection string in
3
24035
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I tried to update the links by changing the Connect property and refreshing: Set td = db.TableDefs(0)...
5
3780
by: Christoph Sticksel | last post by:
Hi, I'm having problems with attaching two tables stored in an SQL Server 2000 to an Access 97 database. It worked well for all other tables except those two. This is what I did: Choose the data source from the ODBC dialog, choose the database on SQL Server login, select all tables in the SQL Server database. All tables were attached except the two, it says something like "database module can't find 'dbo_<tablename>'".
3
2945
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news groups for years, I figure it's time for me to contribute a little bit back, maybe some people out there will find this useful. * Introduction This is a "how-to" style article, showing by example how to dynamically
3
1486
by: mike7510uk | last post by:
hi, i have a gridview with a templatefield that contains a checkbox. this all works fine and update database fine. But the problem i have is that if the user checks a box, closes the application, then re-opens application, the box is no longer checked. How can i check DB for the checked value (in this case a 1 for checked or 0 for unchecked)?
5
5807
by: Edwin Smith | last post by:
Hello: I'm using VS2005 with an ODBC database. I am trying to add a Dialog to an existing Database application to allow the user to select the database. We have 2 different databases with the same schema so this is a very desirable function. I can configure 2 different connection strings in app,config but I can't figure out how to allow the user to select one or the other.
1
1469
by: fran7 | last post by:
Hi, I have this code to randomly select an image from a sequence of fields in my database. Does anyone know if rather than random, one could simply move from one field to the next sequentialy. That would stop the problem of it randomly selecting the same field twice? The idea is that on page refresh the next pic is selected. It works a treat randomly. I have been told its not possible as how does the webpage remember what the last pic...
1
2412
by: Tony Johansson | last post by:
Hello! I use VS 2005. A Datasource can be a Database, Web Service or an Object. So I select Data->Add New Data Source in the menu. In the dialog data Source Configuration Wizard I choose Database. When being asked about Choose Your Data Connection I click New Connection.
8
2736
by: sloney | last post by:
I am trying to build relationships between mulitple tables and was wondering if there is a way to determine all tables in a database that contain the same attribute. Thanks in advance for your thoughts! Sloney
1
1199
by: abhishek1234321 | last post by:
I there any way to select tables using wildcards? like for example i have 100 tables in my database with names "1rn08cs001" "1rn08cs002"... etc now i want a wild card method to select oly the tables from 1rn08cs001 to 1rn08cs005 is this the right way mysql_query("SELECT * FROM REGXP 'some regular expression'"
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.