export data as .txt1.open the"tool"-->"wizard",select "data transfermation services",seclect DTS 
  export wizard2.in "choose a data source" window,select the database which contain ur tables
  (remember to choose OLE DB provider for SQL sever)3.at the next step,remember to choose the dastination of "TEXT FILE" and fill in
  ur text filename.4.the important step. don't forget to select the choise of "use a query to ..."5. in the "type sql statement"window,click the "query builder"botton.6. now choose the table u want,and u can modify the column!try it again as import!
  

解决方案 »

  1.   

    那如何通过前台(delphi) 中的sql语句实现 是在写在(query)控件?中
      

  2.   

    1.define a variable
     var sStr:TStringList;
    2. create it
     sString=TstringList.create;
    3.operate the querywith query do 
    begin
      close; 
      sql.clear;
      sql.add('select field0+field1+field2+..... from tempTab');
      open;
      sStr.clear;
      for i:=0 to recordcount do
        begin
          sStr.add(field[0].AsString);
          next;
        end;
      sStr.savetoFile('c:\back.txt');
      sStr.free;
      close;
    end;
      

  3.   

    1.define a variable
     var sStr:TStringList;
    2. create it
     sString=TstringList.create;
    3.operate the querywith query do 
    begin
      close; 
      sql.clear;
      sql.add('select field0+field1+field2+..... from tempTab');
      open;
      sStr.clear;
      for i:=0 to recordcount do
        begin
          sStr.add(field[0].AsString);
          next;
        end;
      sStr.savetoFile('c:\back.txt');
      sStr.free;
      close;
    end;