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

推荐订阅源

F
Fortinet All Blogs
Recent Announcements
Recent Announcements
H
Help Net Security
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
小众软件
小众软件
Last Week in AI
Last Week in AI
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
V
V2EX
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿

博客园 - 金大侠

基于Extjs web设计器 DataTable使用方法总结 大话prototype Js生成组织结构图 关于读取windows域的用户最后登录时间 经典javascript 一行文字显示不了,用...替代解决方案 .net 发送邮件 .net生成略缩图 将word转换成其它文件 数据挖掘 Web 控件库 SQL Server 2005 在MDX中的新特性 客户端访问WebService Smart Client 解决导出Excel格式问题 泛型学习 asp.net优化方案 windows2008 IIS7.0使用手记 图片推理1
Sqlserver 差异备份
金大侠 · 2011-10-19 · via 博客园 - 金大侠

declare @fileName varchar(100)

  //每个星期完整备份一次,产生一个文件,在代理作业中,每天执行一次

select @fileName='e:\DataBase_差异备份\utsl_'+CONVERT(varchar(10), DATEADD(d, -DATEPART(w,getdate())+1,getdate()),12)+'_diff.bak'

declare @fileExist int
exec xp_fileexist @fileName, @fileExist output

if @fileExist=0 --完全备份
begin
    backup database
    DataBase to disk = @fileName
end
else --差异备份
begin
    backup database

    DataBase to disk = @fileName
    WITH DIFFERENTIAL
end