title: how to create utility stored procedure and run it like other sp_... utilities
body: <p>I need to create a stored procedure <strong>one time and in one place only</strong> on my database server, but be able to run it from any database.  <strong>However, I don't want to have to type <code>database.schema.procedure_name</code> every time I run it.</strong>  I'd like to be able to use it like the built in procedures: <code>sp_...</code>  is there any way to do this?</p>
  
  <p>here is the procedure that I'm trying to create:</p>
  
  <pre><code>--actual procedure is more complex
  CREATE PROCEDURE TestProcedure
  AS
  
  select * from sys.dm_exec_requests 
  
  go
  </code></pre>
  
  <p>here is how I'd like to run it from SQL Server Management Studio:</p>
  
  <pre><code>EXEC TestProcedure
  --or 
  TestProcedure
  </code></pre>
  
  <p>however, you you get this error:</p>
  
  <pre><code>Msg 2812, Level 16, State 62, Line 1
  Could not find stored procedure 'TestProcedure'.
  </code></pre>
  
  <p>everything runs fine if I run it with:</p>
  
  <pre><code>EXEC master.dbo.TestProcedure
  --or
  master.dbo.TestProcedure
  </code></pre>
  
  <p>you can run system procedures like this without any errors:</p>
  
  <pre><code>EXEC sp_help
  --or
  sp_help
  </code></pre>