January 31, 2011 at 10:42 pm
Hi,
I want to take list of tables and columns in a given SQL Query using a procedure.
Thanks In Advance
January 31, 2011 at 11:27 pm
Will the below help you?
Select A.name,B.name From sys.objects A
Inner join sys.columns B On A.object_id = B.object_id Where A.object_id >50
Order by A.name asc
January 31, 2011 at 11:40 pm
Hi,
This query will list the columns and tables in a database. But i want to take the table names and column names in SQL Query. I will pass a SQL Query to the procedure and the proc should return the tablenames and column names in the passed query. For an example, If the query is 'Select Employee_Id From Employees', Then the proc should return table name as Employees and Column name as Employee_Id.
February 1, 2011 at 1:00 am
February 1, 2011 at 3:09 am
Hi,
Thanks for responding. I found an online application which does this job. It might be useful to you.
Click the URL given below and type a SQL query in the text box.
Then select the output as 'List DB Object' and hit 'Format SQL' button
you can see the list of tables and columns used in the typed query.
http://www.dpriver.com/pp/sqlformat.htm
Once again thanks for responding to my post.
February 1, 2011 at 3:31 am
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply