Sahil Malik said:
What are your feelings about using RaiseErrors in stored procedures in an
ADO.NET world?
Any time an error condition occurs in a stored procedure without causing a
SQL Server error, you should return the error to the user with RAISERROR.
For instance, in this procedure an update matching 0 rows will not generate
a SQL Server error, but it does represent a real application error. Here
you should use RAISERROR.
create procedure t_update(@a int, @id int)
as
update t set a=@a where id=@id
if @@rowcount = 0
begin
raiserror('Row in T could not be found for updating',16,1)
return 1
end
David