If you are using Microsoft SQL Server you can use one of these queries.
<pre>SELECT *
FROM sys.tables</pre>
or
<pre>SELECT *
FROM sysobjects
WHERE xtype = 'U'</pre>
---
If you are using Oracle, you can use one of these:
<pre>SELECT *
FROM all_tables;</pre>
or
<pre>SELECT *
FROM all_objects
WHERE object_type = 'TABLE';</pre>
Last Wiki Answer Submitted: April 17, 2013 7:01 pm by Michael Tidmarsh11,405 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
that is get column and exactly data from your table
As previously mentioned, that depends on what DBMS is used. AFAIK, it only works for a couple of them. It doesn’t work at all for some others. And of those that support sp_columns as a default stored procedure, some don’t use “exec”.
As already mentioned, you need to tell us what DBMS you’re using. Different vendors use different methods. Is it Oracle? DB2? MySQL? SQL Server? Access? Something else?
In essentially every case, you will need a “dynamic” SQL query. For most purposes, it’s not a good design. It will not scale well and it won’t perform well. In small cases, it can work well enough.
select * from cat;
cat is the abbreviation for user catalog; which gives you the list of all tables.
Standard way:
If the BIB files (bibliography?… assuming those are what you are referring to) are not in a SQL database, you can’t use SQL to get their names.
Please provide some description of the environment that you are working in.
Tom
I am very beginner in SQL. I know the Column name, how to find out the table name by using SQL
select table_name from INFORMATION_SCHEMA.columns where column_name=’Your_column_namel’
…how to find out the table name by using SQL
That depends on the database product (the DBMS) that you are using.
Is it DB2? Oracle? SQL Server? Something else?
Tom
exec sp_columns yourtable
that is get column and exactly data from your table
that is get column and exactly data from your table
As previously mentioned, that depends on what DBMS is used. AFAIK, it only works for a couple of them. It doesn’t work at all for some others. And of those that support sp_columns as a default stored procedure, some don’t use “exec”.
Tom
sir
i want to select all the table name from database that have column name Pid and Eid.
only those table that have these two fields
PID and EID.
very very thanks
I am Yogesh.
Sir i have one dout. In my Database table have some values I have another table that table name and value name is same.
For Example
Table Name : OLD1
_________________
S.NO | NAME
———————-
1 | NEW1 // I want to refer this table value NEW1 down side 2 | YOGESH table NEW1. I want this query
_______________
==================================================
Table Name : NEW1
————————–
1 | BANK
2 | NW
Plse send this query to me .
Regards
B.Yogesh
Mobile No; 07200120365
Mail Id: yogeshoracle10g@gmail.com
In my Database table…
As already mentioned, you need to tell us what DBMS you’re using. Different vendors use different methods. Is it Oracle? DB2? MySQL? SQL Server? Access? Something else?
In essentially every case, you will need a “dynamic” SQL query. For most purposes, it’s not a good design. It will not scale well and it won’t perform well. In small cases, it can work well enough.
Tom
And you shouldn’t put phone numbers and e-mail addresses in comments. Put references in your profile if you must.
Tom
For more interesting SQL information, check out Mr. Denny’s SQL Server blog!