Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 getting the name of tables if i know column name

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2007-07-02 : 02:17:56
What query I should write so that
i will get the name of tables in the database
having column name 'Order Number ' and its value must be '2451','2456'

Once I know the name of the the table,I need to know ,in which stored procedure table is used?

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-07-02 : 13:05:55
Although not very reliable, sp_depends gives you good info.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-07-03 : 07:39:22
I don't understand how you can know the column name, and the value, but not what table it is in.
This will tell you which tables your column is in. You should be able to find the values from there.


select
table_name
from
information_schema.columns
where
column_name = 'Order Number'


[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-04 : 01:01:54
1 I dont understand why always you want to do everything dynamically
2 You dont follow your threads http://sqlteam.com/forums/topic.asp?TOPIC_ID=85669
3 Still you didnt explain well enough what you are actullay doing

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -