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

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - SysInfo

[转]一个利用Sql Server 20005的 ROW_NUMBER Function 的分页存储过程. 新域名注册成功.http://sysinfo.com.cn/ 如何在上传图片之前预览图片? - SysInfo - 博客园 The New Controls of ASP.NET 2.0 Installing the ASP.NET "Atlas" Wiki - SysInfo [转]常见的 Web 项目转换问题及解决方案 今天下午回家:提前给大家拜个年! [转]MSN消息提示类(纯js编写) - SysInfo - 博客园 window对象的status、location、name、self、opener属性的使用 RadioButton加入DataGrid模板列引起的问题。 疙瘩汤 NHibernate Response.BinaryWrite()下载时文件名的问题. 细说HTML元素的ID和Name属性的区别 收藏 用JavaScript解决ASP.NET服务器控件造成的刷新问题 为.net中的ListBox控件添加双击事件 子父窗口之间的操作之小例子 用实例说明如何用JavaScript生成XML
asp.net执行.sql文件 - SysInfo - 博客园
SysInfo · 2006-03-06 · via 博客园 - SysInfo

今天同事想通过执行.sql脚本达到恢复初始数据的目的,顺便贴出来,以方便达者.
//应用Process前请引用:System.Diagnostics命名空间.
   string infile=System.Web.HttpContext.Current.Server.MapPath("test.sql");
   Process sqlprocess=new Process();
   sqlprocess.StartInfo.FileName="osql.exe";
   sqlprocess.StartInfo.Arguments=String.Format("-U {0} -P {1} -S {2} -i {3}","sa","123456","192.168.0.28",@infile); //U为用户名,P为密码,S为目标服务器的ip,infile为数据库脚本所在的路径
   sqlprocess.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
   sqlprocess.Start();
   sqlprocess.WaitForExit(); //等待程序执行.Sql脚本
   sqlprocess.Close();
   Response.Write("<script>alert('Ok.');</script>");

posted on 2006-03-06 13:45  SysInfo  阅读(1316)  评论()    收藏  举报