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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - eagle

假的.一切都是假的 日复一日, 终竟一事无成, 只是徒增岁月 哎, 人身的事情,真的难易测算, 我靠 .Net Framework Samples 资源,与大家共享 日光穿梭得好快呀 新年到了, 为啥感觉不到新年的喜悦呢? 难道是.... Windows Remote Desktop Web Edition 年终了,呵呵,回顾一年,好象啥事也没有做成也,郁闷也 Windows 2003 Server SP1 出来了 转(感悟生于七十年的人的尴尬) 呵呵, 要过年了, 为什么自己的事情豪无进展, 郁闷呀 转眼就到了11月8号了, 一事无成呀, 郁闷 今天到Microsoft SQL Server网站看了一下, 觉得SQL2005的功能好强大约 无聊, 没有本事,充有本事 昨天出差一天, 到北培去了,解决问题 Bulk data transactions using OpenXML SQL Server的补丁: 今天辛苦工作一天, 感觉没有收获, 呵呵, 累呀 在无聊和痛苦中度过一天! 真是郁闷呀
SQL Server自动备份的SP, 只要加上数据库名, 和路径即可.
eagle · 2004-11-01 · via 博客园 - eagle

CREATE procedure sp_backDB @dbname varchar(100),@path varchar(100)
as


--create by Allen 2004-11-01 in order to backup database  and verify database

 
declare @bakname varchar(
100)
--declare @dbname varchar(100)
declare @sql varchar(
8000)
--declare @sql1 varchar(8000)
--declare @path varchar(100)
--set @path='c:\'
--set @dbname='northwind'
set @bakname=@dbname+cast(datepart(weekday,getdate())-1 as varchar(1)) 
--星期日到星期六对应备份文件是bak0到bak6



set @sql='BACKUP DATABASE ['+@dbname+'] TO DISK=N'''+@path+''+@bakname+'.bak'' WITH INIT,NOUNLOAD,NOSKIP,STATS=10,NOFORMAT'
--print @sql

set @sql=@sql+' DECLARE @i INT
select @i = position from msdb..backupset where database_name='''+@dbname+'''and type!='''+'F'''+' 
and backup_set_id
=(select max(backup_set_id) from msdb..backupset where database_name='''+@dbname+''')
RESTORE VERIFYONLY FROM   DISK 
= N'''+@path+''+@bakname+'.bak'''+'  WITH FILE = @i'
--print @sql

exec(@sql)

就备份到指定的目录下, 星期天到星期六依次循环,(0---6)

posted on 2004-11-01 11:49  eagle  阅读(2939)  评论(3)    收藏  举报

刷新页面返回顶部