Re: Job XXX started successfully.
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 07/30/04
- Next message: Mischa Sandberg: "Re: Return the Set Difference of a tuple, how??"
- Previous message: Just D.: "Re: Remote connect"
- In reply to: David N: "Job XXX started successfully."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 21:16:37 -0500
This message is informational and shouldn't raise an exception in your code.
I ran a test with the following and the job was started without problems.
Is your code similar?
Procedure:
CREATE PROC usp_StartJob
AS
EXEC msdb..sp_start_job 'MyJob'
GO
Code:
static void Main()
{
try
{
string connectionString =
"Data Source=MyServer;" +
"Initial Catalog=MyDatabase;" +
"Integrated Security=SSPI";
SqlConnection connection =
new SqlConnection(connectionString);
connection.Open();
SqlCommand command =
new SqlCommand("usp_StartJob", connection);
command.CommandType = CommandType.StoredProcedure;
command.ExecuteNonQuery();
connection.Close();
Console.WriteLine("Done");
}
catch (SqlException ex)
{
throw new ApplicationException("usp_startjob failed: " +
ex.ToString());
}
Console.ReadLine();
}
-- Hope this helps. Dan Guzman SQL Server MVP " David N" <dq.ninh@netiq.com> wrote in message news:%239btYFddEHA.3864@TK2MSFTNGP10.phx.gbl... > > Hi All, > > I have a stored procedure that is called by C# code to start a SQL agent > job. The stored procedure simply call the MS SQL system procedure > msdb..sp_start_job to start the job. The problem is that after the job > started, the message "Job XXX started successfully." is raised and the C# > code bomb out. > > Is there a way to tell SQL not to raise the message "Job XXX started > successfully." > > Thanks > >
- Next message: Mischa Sandberg: "Re: Return the Set Difference of a tuple, how??"
- Previous message: Just D.: "Re: Remote connect"
- In reply to: David N: "Job XXX started successfully."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|