use AdventureWorks
Select * From sys.columns
select * from sys.tables
-- Select Columns From All Tables
select st.name, sc.name from sys.tables st, sys.columns sc
where st.object_id = sc.object_id
-- Select Specific Columns and their corresponding tables
select st.name, sc.name from sys.tables st, sys.columns sc
where st.object_id = sc.object_id
and sc.name = 'EmployeeID'
-- Select Specific Columns and their corresponding tables
select st.name, sc.name from sys.tables st, sys.columns sc
where st.object_id = sc.object_id
and sc.name = 'PurchaseOrderID'
Showing posts with label Select Columns From All Tables. Show all posts
Showing posts with label Select Columns From All Tables. Show all posts
Wednesday, May 9, 2007
Subscribe to:
Posts (Atom)