I am executing a command in this way :
var Command = new SqlCommand(cmdText, Connection, tr);
Command.ExecuteNonQuery();
In the command th
You'll only get an exception in C# if your error's severity is 16 or above. If you are using a PRINT, you won't get an exception in .NET.
If you can edit the raise error code, this would cause a SqlException in C#:
RAISERROR('Some error message', 16, 1)
You can then get to each individual error in the SqlException.Errors collection.
Just a side-note - SQL Server will continue to run commands after the RAISERROR if you don't RETURN directly afterwards. If you don't return, you can get multiple errors back.