SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need to list all columns,table names used in T-SQL Query


Need to list all columns,table names used in T-SQL Query

Author
Message
krish.sett
krish.sett
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 319
Hi All,

Recently we are planning to do some schema level changes to few tables, so now i have to find out all the depended scripts/SSRS reports/SSIS packages which are using those columns.
we have around 60 reports and around 20+ T-SQL scripts.

As its regular task as part of dev cycle my manager asked me to create report with all Object References to packages/SSRS

To be more clear the Object references report will have below fields

BI Type Name TableNames ColumnNames
SSRS Report1 SimpleTable1 Col1,Col2,COl3
SSRS Report1 SimpleTable2 COl4,Col5,COl7
SSIS Package1 Table5 Col6,Col1

Please let me know if there is any automated way to find reference fileds.

I know there is way to find out related tables in a Stored procedure but is there any way i can find column names also ?

Regards,
Krish
dwain.c
dwain.c
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7429 Visits: 6431
That's going to be quite a challenge if it is possible at all.

You might want to look at this recent thread: http://www.sqlservercentral.com/Forums/Topic1351799-392-1.aspx

Look for the suggestion by Eugene Elutin to generate and parse the XML query plan. It may be possible to do what you want to do that way, then again maybe not.

And by all means, pay homage to Mona at the end. :-)


My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
My temporal SQL musings: Calendar Tables, an Easter SQL, Time Slots and Self-maintaining, Contiguous Effective Dates in Temporal Tables
Lynn Pettis
Lynn Pettis
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40150 Visits: 38567
Duplicate post. Please post all further responses here.

Please, don't make duplicate posts, it just fragments your answers to your questions. Most people that help here either subcribe to specific forums, or use the Recent Posts or Active Threads links to monitor questions.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search