Dropped sp_spaceused

  • Hi Friends,

    I am Pradeep. Today while testing something I have dropped the sp_spaceused stored procedure from the Master database. Please suggest me how to re-create it other than by rebuilding the master database. Please help me out..

    Regards,

    Pradeep

  • Look for a file procsyst.sql in the Install directory of your SQL Server installation (default of C:\Program Files\Microsoft SQL Server\MSSQL\Install). If you do a search for sp_spaceused, you'll eventually find the stored procedure code which you can copy and execute. Once you do, you'll need to regrant EXECUTE on it to public.

    K. Brian Kelley
    @kbriankelley

  • Thanks Mr. Brian Kelley. Now I have the sp_spaceused back.

  • Somehow, the SQL Server configuration has been modified to allow system administrators to drop or change system components.

    To view the configuration, run stored procedure sp_configure and look at the value for "allow updates".

    The value of 1 indicates changes to system components are allowed and a 0 indicates that changes are not allowed.

    To disable changes, run

    sp_configure 'allow updates' , 0

    go

    reconfigure with override

    go

    SQL = Scarcely Qualifies as a Language

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply