About Me

Colorado
Paul has 18 years experience with Microsoft SQL Server. He has worked in the roles of production DBA, database developer, database architect, applications developer, business intelligence and data warehouse developer, and instructor for students aspiring for MCDBA certification. He has performed numerous data migrations and supported large databases (3 Terabyte, 1+ billion rows) with high transactions. He is a member of PASS, blogs about lessons learned from a developer’s approach to SQL Server administration, and has been the president of the Boulder SQL Server Users’ Group for 11 years, from January 2009 to 2020.

Thursday, January 16, 2014

Return full name of procedure (3 part naming convention)


CREATE PROC dbo.TestProc
AS
/*    DATE        AUTHOR            REMARKS
      1/2/14            PPaiva            Initial creation.

      USAGE
            TestProc

*/

DECLARE @ProcName sysname

SET @ProcName =   db_name() + '.' +
                              user_name(objectproperty(@@procid,'OwnerId')) +
                              '.' + object_name(@@procid)

SELECT @ProcName