Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
Oct 8

Written by: Steve Gray
10/8/2010 2:51 PM  RssIcon

I can across this today in an email from http://www.sqlshare.com. If you’re reading this and you don’t subscribe to them, you need to.

@@ProcID is a SQL function that returns the name of the currently processing procedure. Here’s a small script that demonstrates it’s use

IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'FP_test' 
)
   DROP PROCEDURE dbo.FP_test
GO

CREATE PROCEDURE dbo.FP_test

AS

select @@PROCID as ProdID,object_name(@@PROCID) as ProcName

GO

grant exec on FP_test to public

And the results look like this:

 

SNAGHTML16222b38

Tags:
Categories:
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us