• depnumber=1 seems to limit the outputs

    but I think the purpose was to only show UNIQUE tables (example below should only show BillOfMaterials and Product)

    In AdventureWorks2008 (on SQL2008)

    SELECT DISTINCT

    o.id, o.name AS 'Procedure_Name' , oo.name AS 'Table_Name', d.depid

    --, d.depnumber -- comment this out returns unique tables only

    FROM sysdepends d, sysobjects o, sysobjects oo

    WHERE o.id=d.id

    AND o.name= 'uspGetBillOfMaterials' -- Stored Procedure Name

    AND oo.id=d.depid

    --and depnumber=1

    ORDER BY o.name,oo.name

    returns

    idProcedure_NameTable_Namedepiddepnumber

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757992

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757993

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757994

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757995

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757997

    2123154609uspGetBillOfMaterialsBillOfMaterials2135757998

    2123154609uspGetBillOfMaterialsProduct17175811571

    2123154609uspGetBillOfMaterialsProduct17175811572

    2123154609uspGetBillOfMaterialsProduct17175811579

    2123154609uspGetBillOfMaterialsProduct171758115710

    SQLServerNewbieMCITP: Database Administrator SQL Server 2005