有主备两个数据库,sql server 2000的
怎么在两个数据库的表中复制数据呢,就是更新两个表中的内容,保证主备一致
我用了table2.BatchMove 可更新完后进行restore还原操作确提示数据库正在使用,更新完后我已经用table.close释放了
请问还有什么办法可行吗
谢了,急,在线等
怎么在两个数据库的表中复制数据呢,就是更新两个表中的内容,保证主备一致
我用了table2.BatchMove 可更新完后进行restore还原操作确提示数据库正在使用,更新完后我已经用table.close释放了
请问还有什么办法可行吗
谢了,急,在线等
解决方案 »
- delphi6编辑器输入不了中文
- query 返回 多个结果,怎么汇总 到一个里变量,直接或间接的方法都可以,比方说query结果有只有3行呢?就一列的情况下
- 为什么提示 Unsatisfied forward or external declaration
- .......................................................................................
- 线程中的异常问题,给出合理答案或解决送500
- adoquery的删除错误,请教!
- 哈,体验一下放200分的感觉
- 各位请进!
- 我怎样得到AdoStoreProc中返回的参数?
- 谁知道是窗体最大化的消息是什么?
- 滚动一个RichEdit 。
- 帮忙看一看吧,数据库如何设计好?用什么报表,怎么做?急~~分有的是!!
代码:
try
Table1.Close;
Table2.Close;
//table3.Close;//********************更新sourceclip表***************************
table1.DatabaseName :=hbz;
//table1.Close;
table1.tableName :='sourceclip';
table1.Open;
table2.DatabaseName :=hbb;
table2.tableName :=table1.TableName ;
if not table2.Exists then
begin
batchmove:=tbatchmove.Create(application);
table2.BatchMove(table1,batcopy); //table1.IndexDefs.Update;
table2.AddIndex('newsourceclipindex','title',[ixunique]);
batchmove.Free;
//table1.Close;
//table2.Close;
end
else begin
batchmove:=tbatchmove.Create(application);
table2.BatchMove(table1,batappendupdate);
batchmove.Free;
//table1.IndexDefs.Update;
//table2.IndexDefs.Update;
end;//********************end****************************************
table1.free;
table2.free;
showmessage('备数据库更新完成!');
except
on e:exception do
begin
bdelist.Free;
batchmove.Free;
showmessage(e.Message);
exit;
end;
end;
还原操作的代码:
filename:=pathedit.Text+'\'+FileListBox1.Items.Strings[filelistbox1.itemindex];
Query1.Close;
Query1.DatabaseName:=bandr;
//Query1.Close;
Query1.SQL.Clear();
//Query1.SQL.Add('USE master');
Query1.SQL.Add('restore DATABASE '+dbname+' from disk=:dbnamepath with REPLACE');
Query1.ParamByName('dbnamepath').AsString:=filename;
Query1.ExecSQL();
//query1.Active :=true;
showmessage('完成恢复!');能否帮忙看下是什么问题
谢了
去操作管理器多烦,按一个按钮多省事
去操作管理器多烦,按一个按钮多省事
???没事给自己找事型的人物!你能保证你写程序比数据库提供更安全更专业的备份功能吗?
你能保证你写的程序比备份软件提供更安全更专业的功能吗?