Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jimmy_a
Starting Member
38 Posts |
Posted - 2006-02-10 : 03:47:58
|
| V can use SP_DEPENDS to find the dependency sps..Is there any other way to find dependency sps using queries..Can any one help me in this ...Thnks in advance |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-02-10 : 04:38:54
|
| deja vui think i responded to this awhile ago...oh wellcheck the tsql for that sp and modify as you wish HTH--------------------keeping it simple... |
 |
|
|
jimmy_a
Starting Member
38 Posts |
Posted - 2006-02-10 : 04:50:34
|
| THSI IS THE QUERY ...SELECT DISTINCT O.NAME FROM MASTER.DBO.SYSOBJECTS O,MASTER.DBO.SYSDEPENDS D,MASTER.DBO.SYSUSERS S WHERE O.ID = D.IDAND O.XTYPE = 'P' AND D.DEPID = (SELECT OBJECT_ID( 'SPC_AEPDtl_Sp_VwDtPSPrSeMl' )) AND O.UID = S.UID AND DEPTYPE < 2If i use that query i can only able to access in master DB.. But i couldnt access from diff DB |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-02-10 : 05:01:07
|
| Please don't cross post. Stick to one thread please.----------------------------------'KH'everything that has a beginning has an end |
 |
|
|
jimmy_a
Starting Member
38 Posts |
Posted - 2006-02-10 : 05:28:14
|
| Sorry...Im in a urgent need for this solution..Thats y posted in both...Sorry for the Inconvenience |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-02-10 : 06:07:32
|
Beware that sysdepends table is not reliable. If you drop an recreate a "child" object all "parents" that used to refer to it [in sysdepends] will no longer do so until they too are dropped and recreated  PRINT 'Create usp_ProcA'GOCREATE PROCEDURE dbo.usp_ProcAASSELECT TOP 10 * FROM dbo.sysobjectsGOPRINT 'Create usp_ProcB'GOCREATE PROCEDURE dbo.usp_ProcBASEXEC dbo.usp_ProcAGOSELECT DISTINCT [sysdepends(1)] = O.name + '->' + C.name -- , D.*FROM dbo.sysobjects AS O JOIN dbo.sysdepends AS D ON D.id = O.id JOIN dbo.sysobjects AS C ON C.id = D.depidWHERE O.name LIKE 'usp_Proc[AB]'GOPRINT 'RE-Create usp_ProcA'GODROP PROCEDURE dbo.usp_ProcAGOCREATE PROCEDURE dbo.usp_ProcAASSELECT TOP 10 * FROM dbo.sysobjectsGOSELECT DISTINCT [sysdepends(2)]=O.name + '->' + C.name -- , D.*FROM dbo.sysobjects AS O JOIN dbo.sysdepends AS D ON D.id = O.id JOIN dbo.sysobjects AS C ON C.id = D.depidWHERE O.name LIKE 'usp_Proc[AB]'GOPRINT 'Tidy up'GODROP PROCEDURE dbo.usp_ProcAGODROP PROCEDURE dbo.usp_ProcBGO Kristen |
 |
|
|
jimmy_a
Starting Member
38 Posts |
Posted - 2006-02-10 : 07:54:53
|
| Thnks for ur timely info... It works for me |
 |
|
|
|
|
|