i have a stored procedure
UPDATE tblTime
SET TimeOut = DATEADD(HOUR,8,TimeIn)
WHERE tId =
(
SELECT MAX(tId)
FROM tblTime
WHERE UserId = 3571
)
although there’s no question really, in that case if it did succeed in this query
cause even if the field is empty or if it has value,
it will in this case succeed
but i do need it for future other queries… and also ,
in this case i want the C# code to report
not only that it was requesting query to be execute – meaning it did happen,
but to get an actual answer from sql server
as a return value that c# could use or turn into Boolean
i have managed to do somthing about this so i can specify a condition inside sql server stored proc
declare an
OUTPUTvariable(PARAMETER) thenset its value to say 1 if condition is met and -1 if not
then
in c# set a function as follows
in this example outpout parameter is named
ERRORstored proc is then allways following the same pattern
declare
ERRORparameter, set a condition to output the ERROR accordingly :so it does what you want only if you allowed it by the condition
then reports the action so you can handle it in program code behind .