EXEC master..xp_cmdshell  bcp "Northwind.[Jane Doe].[Jane's Orders]" out "Jane's Orders.txt" -c -U"Jane Doe" -P"go dba"  怎么执行,格式是什么?

解决方案 »

  1.   

    换一个角度来执行。cmd="Path to bcp.exe"
    para= "\"Northwind.[Jane Doe].[Jane's Orders]\" out \"Jane's Orders.txt\" -c -U\"Jane Doe\" -P\"go dba\"";System.Diagnostics.Process proc = new System.Diagnostics.Process();
    proc.EnableRaisingEvents=false;
    proc.StartInfo.FileName=cmd;
    proc.StartInfo.Arguments=para;
    proc.Start();
    proc.WaitForExit();
    MessageBox.Show("Finished.");  
    --------------------------------------------------------------
    程序,犹如人生。