*********************************************************
** Find The Names And Types Of The T-SQL Objects
** Used In A Stored Procedure
**
** By: Dave Vroman
*********************************************************/
DECLARE @ProcName VARCHAR(50)
SET @ProcName = 'MyTestProc'
SELECT [Name],
CASE WHEN xType = 'C' THEN 'CHECK Constraint'
WHEN xType = 'D' THEN 'Default Or DEFAULT Constraint'
WHEN xType = 'F' THEN 'FOREIGN KEY Constraint'
WHEN xType = 'L' THEN 'Log'
WHEN xType = 'FN' THEN 'Scalar Function'
WHEN xType = 'IF' THEN 'Inlined Table-Function'
WHEN xType = 'P' THEN 'Stored Procedure'
WHEN xType = 'PK' THEN 'PRIMARY KEY Constraint (Type Is K)'
WHEN xType = 'RF' THEN 'Replication Filter Stored Procedure'
WHEN xType = 'S' THEN 'System Table'
WHEN xType = 'TF' THEN 'Table Function'
WHEN xType = 'TR' THEN 'Trigger'
WHEN xType = 'U' THEN 'User Table'
WHEN xType = 'UQ' THEN 'UNIQUE Constraint (Type Is K)'
WHEN xType = 'V' THEN 'View'
WHEN xType = 'X' THEN 'Extended Stored Procedure'
ELSE xType END AS xType
FROM sysobjects
WHERE id IN
(SELECT sd.depid FROM sysobjects so, sysdepends sd
WHERE so.name = @ProcName AND sd.id = so.id )
--------------------------------------------------
SELECT Distinct SO.Name, SO.Type
FROM sysobjects SO (NOLOCK)
INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
--AND SO.Type = 'P' --U,P,V
AND SC.Text LIKE '%ObjectsName%' --need to be replicated
ORDER BY SO.Name
------------------------------------------------------
Subscribe to:
Post Comments (Atom)
Disable Microsoft Defender for Cloud for Visual Studio Subscription (MSDN)
I use a visual studio pro subscription which comes with $150 azure cloud credit, for some reason Microsoft Defender for Cloud was turned on ...
-
Error 15401: Windows NT user or group '%s' not found. Check the name again. SELECT name FROM syslogins WHERE sid = SUSER_SID ('Y...
-
Finally, it is time. E4SE 811 and eBackoffice 736 will replace our current 810b/735a environment after staying so many years. Just got the n...
-
/etc/ipsec.config conn ios keyexchange=ikev1 authby=xauthrsasig xauth=server lef...
No comments:
Post a Comment