用存储过程清除数据库日志

 

搞个SP来清日志也比较爽 呵呵 
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
--
 powered by donets.cnblogs.com
--
 =============================================
CREATE PROCEDURE [dbo].[ClearLog]
 
AS
BEGIN   

    
SET NOCOUNT ON;
--
=============================================
-- powered by donets.cnblogs.com
--
 =============================================
    DECLARE @DB_Name nvarchar(500)
    
Set @DB_Name=db_name()
    
BACKUP LOG @DB_Name WITH NO_LOG;
    
DBCC SHRINKDATABASE (@DB_Name,0);
END

posted on 2007-04-14 11:32  随风.Net  阅读(308)  评论(0编辑  收藏  举报

导航