SQL娄据库好像自已有提供一个backup的命令就可用。

解决方案 »

  1.   

    我送你一个工具叫datapump
    很好用的,你的email给我,我的email是[email protected]
      

  2.   

    to liet(liet):
    我用的是SQL Server2000
      

  3.   

    to dingzhenhhy:
    问题是在SQL数据库中怎样将表作为文件拷贝.
      

  4.   

    xiaonan()给我一个datapump:[email protected] 
      

  5.   

    给你个过程:Procedure DataSettoText(ADataSet: TDataset);
    var
    i: integer;
    str: string;
    tmpStringList: TStringList;
    tmpSaveDialog: TSaveDialog;
    begin
    if ADataset = nil then Exit;
    if not ADataset.Active then Exit;
    tmpStringList := TStringList.Create;
    tmpSaveDialog := TSaveDialog.Create(nil);
    tmpSaveDialog.DefaultExt := '*.txt';
    tmpSaveDialog.Filter := 'Text File(*.txt)|*.txt';
    try
    //添加标题
    For i := 0 to ADataset.FieldCount - 1 do
    str := str +' ' + Format('%0'+ inttostr(ADataset.Fields[i].DisplayWidth) + 's',[ADataset.Fields[i].DisplayLabel] );
    tmpStringList.Add(str);
    ADataset.First;
    while not ADataset.Eof do begin
    str := '';
    For i := 0 to ADataset.FieldCount - 1 do
    str := str + ' '+ Format('%0'+ inttostr(ADataset.Fields[i].DisplayWidth) + 's',[ADataset.Fields[i].asstring] );
    tmpStringList.Add(str);
    ADataset.Next;
    end;
    if tmpSaveDialog.Execute then begin
    if tmpSaveDialog.FileName = '' then begin
    showmessage('文件名不能为空!');
    exit;
    end;
    tmpStringList.SaveToFile(tmpSaveDialog.FileName);
    end;
    Finally
    tmpStringList.Free;
    tmpSaveDialog.Free;
    end;
    end;你用个TTable读出你的表,再引用这个就可以了。这是个笨办法,如果哪位有好的方式请赐教。