SQL Server Performance

Finding an aliased column's original name and table

Discussion in 'General Developer Questions' started by rhesje, Apr 25, 2008.

  1. rhesje New Member

    Hi,

    I need to find out where the columns in a number of functions are coming from.
    Myproblem is that the functions tend to pull information from more thanone table and the columns are aliased within the function. I would like to query this information out of the system tables.

    I am trying to write a query that will return the following:
    - Column name from a given view/function (based on objectID)
    - Table name of the table where the column comes from
    - Column name of the column as it appears in the table (for aliased columns)

    I want the query to be parameterized by passing it an objectid or objectname.

    Is there a way to write this using the system tables or information_schema views? I've been trying to figure out what I could join these tables on to get this information but have so far come up with nothing.
  2. madhuottapalam New Member

    In the current versions ( sql 7/2000/2005) finding dependency is not fool proof. There are issues in all the versions. there are two sps (sp_depends/sp_msdependencies which is not useful for all the case. But yes in sql server 2008 this issues is solved and there are many new system sps and function which gives you complete dependecies.
    Madhu

Share This Page