惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
罗磊的独立博客
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Jina AI
Jina AI
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
C
Check Point Blog
GbyAI
GbyAI

博客园 - gamebaby

去掉rhel 6的缺少授权证书提示 c++消息 脚踏实地向前走 读xml内容 - gamebaby - 博客园 InvokeMember Invoke 项目经理应该知道的. 获取表信息 Email(VB.net) - gamebaby - 博客园 Email(C#) - gamebaby - 博客园 主外键 转义符 常规触发器 创建数据库 触发器 CASE 语句 事务处理 游标例子2(转载) 游标例子1(转载)
Clear Sqlserver log
gamebaby · 2007-04-17 · via 博客园 - gamebaby

print ''
if Exists( Select * From sysObjects where name='spClearLog' )
Drop Proc spClearLog
go


Create Proc spClearLog(@sDataBase sysname)

  With Encryption
As
Begin
  Declare @Sql           nvarchar(1000)
  Declare @LogLogicName  nchar(128)

  Set @Sql='Select @insLogLogicName=Name From '+@sDataBase+'.dbo.sysfiles Where GroupID=0'
  Exec sp_ExecuteSql @Sql,
                     N'@insLogLogicName nchar(128) output',
                     @LogLogicName  output

  Set @Sql='
             Backup log '+@sDataBase+' with no_log
             Use '+@sDataBase+'
             Dbcc ShrinkFile('+@LogLogicName+',1)
           '
  Exec sp_ExecuteSql @Sql
 

End

Go