各位老大,真的很急,有谁知道麻烦告诉我。bcp命令是在哪里执行的?我在查询分析器里执行的时候提示存储过程不能使用out什么的错误。

解决方案 »

  1.   

    用vb调用win api打开一个command窗口(当然你可以不让它显示出来)然后在里边执行bcp命令。bcp命令的具体用法:
    用法:  bcp {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"]
    进一步的用法到book online里去查吧。
      

  2.   

    SQL没有队表备份的这一个概念!最多是把数据倒出来,这也算备份么? 用BCP或者 DTS都可以
      

  3.   

    直接在VB中调用备份的SQL语句就行了:)
    导入导出直接用SQL完成