|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, November 17, 2009 12:49 PM
Points: 8,
Visits: 25
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 19, 2008 2:46 AM
Points: 5,
Visits: 9
|
|
| i am unable to get the name of tables if the storedprocedure is very long and storedprocedures using the dynamic querys can u help in this regards
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 31, 2011 4:21 PM
Points: 7,
Visits: 18
|
|
Please note just creating the stored procedure will not bring the table names being used within the stored procedure. To get the list of table names being used with the above said logic, the stored procedure should have been executed at least once. For e.g Exec your_sp_name parameters.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 19, 2008 2:46 AM
Points: 5,
Visits: 9
|
|
i have executed the sp but still i am unable to get the table names
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 19, 2008 2:46 AM
Points: 5,
Visits: 9
|
|
| i got the solution by removing depnumber=1 i am able to get the details
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Wednesday, June 05, 2013 1:56 PM
Points: 769,
Visits: 1,167
|
|
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
id Procedure_Name Table_Name depid depnumber 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 2 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 3 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 4 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 5 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 7 2123154609 uspGetBillOfMaterials BillOfMaterials 213575799 8 2123154609 uspGetBillOfMaterials Product 1717581157 1 2123154609 uspGetBillOfMaterials Product 1717581157 2 2123154609 uspGetBillOfMaterials Product 1717581157 9 2123154609 uspGetBillOfMaterials Product 1717581157 10
SQLServerNewbie
MCITP: Database Administrator SQL Server 2005
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 19, 2008 2:46 AM
Points: 5,
Visits: 9
|
|
i have found that the storedprocedure id is missing in sysdepends table but the storedprocedured is present in the database .
can any one tell me why the id's of some of the storedprocedures are not turning up in sysdepends table
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 19, 2008 2:46 AM
Points: 5,
Visits: 9
|
|
| storedprocedure id is present in sysobjects table but it is not there in sysdepends table can u let me know why this discrepancy
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 9:43 AM
Points: 6,
Visits: 276
|
|
I don't seem to get any tables back if the stored procedure references linked server tables. Is there a way to remedy this?
thanks
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 15, 2011 12:26 AM
Points: 1,
Visits: 18
|
|
hey
i have got the list of procedures, but din't get all the SP's. also i have refreshed the DB an d checked tht. but still some of the SP's are missing from the list
|
|
|
|