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

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - FireReprt◇FireScript地带

3ds文件转换为.X文件 MD5加密 SPS恢复问题: [ 提示数据库架构太旧问题 ] 运算符的优先级别 补上一个测试精灵动画的列子 - FireReprt◇FireScript地带 - 博客园 关于CSGL跟FireScript的连接 脚本中类的声明 加入了两个终结符号 - FireReprt◇FireScript地带 - 博客园 脚本支持数组初始化了 - FireReprt◇FireScript地带 - 博客园 IF语句多分支识别 用自定义函数来实现代理类的实例化 测试递归 这是我在C#中测试速度的代码 测试运行效率 加入了静态类的语义分析引擎 FireScript调用DLL和COM FireScript在SharePoint中的应用 识别字符串中的表达式(续二) 识别字符串中的表达式(续一)
[转载]使用SQL直接从sps数据库中恢复文档
FireReprt◇FireScript地带 · 2006-04-25 · via 博客园 - FireReprt◇FireScript地带
张贴者: photo2000
张贴时间: 2006-1-19 23:38
主题:

使用SQL直接从sps数据库中恢复文档

文本:

我的一个客户误删除了一个项目站点,其中有大量的文档需要恢复。由于,这个站点构建在他的SPS之下,而他们的sps数据库非常大,我费了一天的时间将他前天的数据库备份恢复到另一个数据库服务器上。我在试图重新架设一个同样的门户时遇到了一些问题,于是,我想,是否通过sql直接送库中恢复文档来得更加直接
sps的文档都存放在***_SITE数据库的docs表中,表中dirname字段存放了站点的URL后边的部分,leafname则存放的是文件或文件夹的名称,content中存放的是文件的内容,type中标识了该条目是文件还是文件夹(0表示是文件,1表示是文件夹),于是,我编写了一段代码对这个文档库下的文档进行恢复:
        string strFilesID="";
int nCount=0;
 
System.Data.SqlClient.SqlCommand myCmm=new SqlCommand();
myCmm.Connection=sqlConnection2;
myCmm.CommandText="select dirname,leafname,content from docs where dirname like '%%projectserver_120/doclib%%' and type='0'";
myCmm.Connection.Open();
 
System.Data.SqlClient.SqlDataReader myReader;
byte[] MyData=new byte [0];
try
{
myReader=myCmm.ExecuteReader();
while (myReader.Read() )
{
nCount=nCount+1;
 
string strFileName="";
string strFolderId="";
//
string strFolderName="dev";
string strPath=@"d:\guangzhou\";
//
strPath=@"h:\test\";
strFileName=myReader.GetString(1);
 
{
strFolderId=myReader.GetString(0).ToString();
strFilesID=strFolderId;
//
strFolderName=strFolderName+strFolderId;
//
strPath=strPath+strFolderName;
strPath=strPath + strFolderId;
Directory.CreateDirectory(strPath);
strPath=strPath+@"\"+strFileName;
MyData=(byte[])myReader.GetValue(2);
int ArraySize=new int();
ArraySize=MyData.GetUpperBound(0);
if (ArraySize>=0)
{
FileStream fs=new FileStream(@strPath,@FileMode.OpenOrCreate,FileAccess.Write);
fs.Write(MyData,0,ArraySize);
fs.Close();
}
else
{
file://eventLog1.WriteEntry ();
string strMyLogName="BatUploadApp";
if (!EventLog.SourceExists("BatUpload") )
{
EventLog.CreateEventSource("BatUpload",strMyLogName);
 
}
else
{
strMyLogName=EventLog.LogNameFromSourceName("BatUpload",".");
}
 
eventLog1.Source="BatUpload";
eventLog1.Log =strMyLogName;
eventLog1.WriteEntry(strFilesID,EventLogEntryType.Information);
 
}
}
 
}
 
MessageBox.Show(nCount.ToString());
 
}
catch(Exception ex)
{
MessageBox.Show(strFilesID +":" + ex.Message);
}
}
 http://www.cnblogs.com/perky_zhou/archive/2005/08/25/222346.html