December 28, 2011 at 1:14 am
Hi all,
I have a sql statement which have multiple table in Join.
I want all the column along with corresponding object.
Example
Sql Statement
-------------
Select * from Table1, Table2 where Table1.id= Table2.id
I need this
ColumnName ObjectName
Column1 Table1
Column1 Table2
Vijay
December 28, 2011 at 2:13 am
This was removed by the editor as SPAM
December 28, 2011 at 2:23 am
What about this:
SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME IN 'Table1','Table2')
[font="Verdana"]Markus Bohse[/font]
December 28, 2011 at 3:26 am
This was removed by the editor as SPAM
December 28, 2011 at 3:56 am
of course we have sysobjects but firstly understand my question, I have Sql Statement not Sql Object.
Statement like "Select * from TableName"
Vijay
December 28, 2011 at 4:06 am
vijay.s (12/28/2011)
of course we have sysobjects but firstly understand my question, I have Sql Statement not Sql Object.Statement like "Select * from TableName"
Vijay
Not sure if this is what you want, but have you tried using FMTONLY ?
SET FMTONLY ON
Select * from TABLE1
Select * from TABLE2
SET FMTONLY OFF
[font="Verdana"]Markus Bohse[/font]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply