我有一个C#控制台应用程序,它调用sqlcmd utiltiy,并获取退出代码为-100。
代码如下所示;
private int RunSP()
{
int exitCode = 1;
Log.Log("Creating Stored Procedure: " + Config.ExternalSPname);
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = string.Format("sqlcmd -S {0} -d {1} -Q \"EXIT(exec {2} @ MainListID=N'{3}', @ TempListID =N'{4}')\"", Config.ExternalSPserver, Config.ExternalSPdb, Config.ExternalSPname, Config.ExternalSPmainlist, Config.ExternalSPtemplist);
Log.Log("SP command: " + p.StartInfo.FileName);
p.Start();
p.WaitForExit();
exitCode = p.ExitCode;
p.Close();
return exitCode;
}
存储过程在其工作时写为返回退出代码1,在失败时写为0。
我想知道在某些情况下sqlmod是否可以返回-100。
由于