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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 command

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2008-09-17 : 07:03:37
hi friends,
Command for identify objects name used inside the sp?
Txs in Advance

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-17 : 07:10:18
objects name? didnt get that. can you elaborate please?
Go to Top of Page

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2008-09-17 : 07:15:19
inside the stored procedure some tables,views, were defined.I need to know what all the object names used inside the stored procedure
quote:
Originally posted by visakh16

objects name? didnt get that. can you elaborate please?

Go to Top of Page

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2008-09-17 : 07:32:27
quote:
Originally posted by sent_sara

inside the stored procedure some tables,views, were defined.I need to know what all the object names used inside the stored procedure
quote:
Originally posted by visakh16

objects name? didnt get that. can you elaborate please?



Go to Top of Page

ranganath
Posting Yak Master

209 Posts

Posted - 2008-09-17 : 08:28:25
hi

Try with this

SELECT Distinct SODP.[Name] AS 'TableName',
a.[Name] AS 'Viewname',
Sc.name as 'Colname',
t.name as 'Datatype',
sc.length
FROM SysObjects SO
LEFT JOIN SysDepends SD ON SO.[Id] = SD.[Id]
LEFT JOIN SysObjects SODP ON SODP.[Id] = SD.DepId
Left join syscolumns sc on sc.id = SODP.[Id]
Left Join (Select Id, name From sysobjects where Type = 'V')A on A.Id = So.Id
Left JOIN master..systypes t ON sc.xtype = t.xtype
WHERE SO.Xtype = 'P'
AND SO.[Name] NOT LIKE 'dt_%'
AND so.id = object_id('USP_AccessManagement_CheckTree')-- spname
ORDER BY 1, 2
Go to Top of Page
   

- Advertisement -