Remove System Stored Procedures in TempDB

Answered Remove System Stored Procedures in TempDB

  • Thursday, February 28, 2013 7:50 PM
     
     

    Good afternoon.

    I've been tasked to remove all 'permanent stored procedures from the TempDB for security compliance.  My concern is the System Stored Procedures located there.  Can I safely remove them or will that cause havoc and headaches?

    Thank you.

    -Todd

All Replies

  • Thursday, February 28, 2013 7:57 PM
     
     

    Hi,

    Those stored procedures are created and managed by SQL engine, IMHO you shouldn't alter or delete them.

    Nevertheless, if you still want to tinker with them do it in a sandboxed environment (where your live servers won't be affected).


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

  • Thursday, February 28, 2013 8:02 PM
     
     

    No It cant, because those required to perform or pull some useful information in-case if any issues(for ex- performance) occurs or required to pull the information.If needed you can modify either in th model or tempdb(if needed so).. but leave as it is.


    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

  • Thursday, February 28, 2013 8:35 PM
     
     Answered Has Code

    There are no system stored procedures in TempDb.  The system stored procedures in the 'sys' schema are actually in the Resource Database.

    Any permanent tables or stored procedures actually present in TempDb were put there by a user or an application.  You can (from SQL Server's POV) safely remove them.  Of course you might break an application.

    eg

    select * 
    from tempdb.sys.objects
    where type in ('U','P')
    and name not like '#%'
    

    One note, the ASP.NET Session Storage script will, by default, use permanent tables in TempDb.  You might not want to remove those.

    David


    David http://blogs.msdn.com/b/dbrowne/

    • Proposed As Answer by Saurabh Sinha DBA Friday, March 01, 2013 10:32 AM
    • Marked As Answer by TUnger Friday, March 01, 2013 1:17 PM
    •  
  • Thursday, February 28, 2013 8:54 PM
     
     
    thanks David,

    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

  • Friday, March 01, 2013 1:17 PM
     
     

    Perfect.  That's exactly what I needed.  Thank you.

    -Todd