sql server - Determine Tables Referenced By Letters In Stored Procedure -


i have stored procedure references few tables. however, refers tables letters.

so let's column called name table users, stored procedure may call column name u.users.

my question is, how list of such mappings i.e letters map table?

you referring table aliases, each distinct query can have own "mapping". these alias values not specific stored procedures. here example:

select    a.col1, a.col2    yourtable1   select     b.col1, b.col2     yourtable2                   inner join yourtable1 b on a.col1=b.col2 

yourtable1.col1 , yourtable1.col2 returned in both of above queries, although have "a" alias in first query , "b" alias in second query. see using table aliases.

in examples above, people use table alias because is quicker write a.col1 yourtable.col1. there no way know aliases used in stored procedure, need figure out, @ these examples help:

from yourtable  --   ^table     ^alias  yourtable --   ^table       ^alias  yourtable1                 inner join yourtable2   b on a.col1=b.col1     --         ^table       ^alias  yourtable1                 inner join yourtable2   b on a.col1=b.col1     --         ^table          ^alias 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -