1、备份
<%
SQL="backup database 数据库名 to disk='"&Server.MapPath("backup")&"\\"&"backuptext.dat"&"'"
set cnn=Server.createobject("adodb.connection")
cnn.open "driver={SQL Server};Server=服务器名;uid=sa;pwd="
cnn.execute SQL
on error resume next
if err<>0 then
response.write "错误:"&err.Descripting
else
response.write "数据备份成功!"
end if
%>绿色c hinaip ower. comAYrCJ6B
2、恢复
<%
SQL="Restore database 数据库名 from disk='"&Server.MapPath("backup")&"\\"&"backuptext.dat"&"'"
set cnn=Server.createobject("adodb.connection")
cnn.open "driver={SQL Server};Server=服务器名;uid=sa;pwd="
cnn.execute SQL
on error resume next
if err<>0 then
response.write "错误:"&err.Descripting
else
response.write "数据恢复成功!"
end if
%>
<%
SQL="backup database 数据库名 to disk='"&Server.MapPath("backup")&"\\"&"backuptext.dat"&"'"
set cnn=Server.createobject("adodb.connection")
cnn.open "driver={SQL Server};Server=服务器名;uid=sa;pwd="
cnn.execute SQL
on error resume next
if err<>0 then
response.write "错误:"&err.Descripting
else
response.write "数据备份成功!"
end if
%>绿色c hinaip ower. comAYrCJ6B
2、恢复
<%
SQL="Restore database 数据库名 from disk='"&Server.MapPath("backup")&"\\"&"backuptext.dat"&"'"
set cnn=Server.createobject("adodb.connection")
cnn.open "driver={SQL Server};Server=服务器名;uid=sa;pwd="
cnn.execute SQL
on error resume next
if err<>0 then
response.write "错误:"&err.Descripting
else
response.write "数据恢复成功!"
end if
%>
标签:
ASP实现SQL备份、恢复
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“ASP实现SQL备份、恢复”评论...