EXEC MASTER..xp_cmdshell 'bcp "select * FROM sysobjects" queryout c:\123.txt -c -SLH -Usa -P '

解决方案 »

  1.   

    今天有一学生问我,我刚测试,可以
    用法:  C:\PROGRA~1\MICROS~4\80\TOOLS\BINN\BCP.EXE {dbtable | query} {in | out | queryout | format} datafile
      [-m maxerrors]            [-f formatfile]          [-e errfile]
      [-F firstrow]             [-L lastrow]             [-b batchsize]
      [-n native type]          [-c character type]      [-w wide character type]
      [-N keep non-text native] [-V file format version] [-q quoted identifier]
      [-C code page specifier]  [-t field terminator]    [-r row terminator]
      [-i inputfile]            [-o outfile]             [-a packetsize]
      [-S server name]          [-U username]            [-P password]
      [-T trusted connection]   [-v version]             [-R regional enable]
      [-k keep null values]     [-E keep identity values]
      [-h "load hints"]
    NULL
      

  2.   

    你可以使用DTS啊,工具-数据转换-数据导出