Last post Jan 28, 2016 07:41 AM by Zhi Lv - MSFT
Jan 06, 2016 09:14 AM|VineetVikram|LINK
I have two tables ERROR and ERROR_TEST , error table have few columns like error_eff_date , error_message having first 6 character as error code and then 36 char as error message.
ERROR_TEST table have 3 columns 6 char error_code_test , 42 char error_message_test and numeric 2 digit threshold.
I need to write an stored procedure where current day errors from error table need to be checked against the errors in error_test table and depending upon the threshold the return code need to be sent.
example suppose error message in error table is "E00001 unable to write financials" and the threshol;d for error E00001 in error-test table is 0 then return code of 16 should come indicating no such error is acceptable , suppose if threshold is 2 the 2 such
errors are acceptable but when 3 similar error comes it should return the return code of 16 with error message and there are several types of error in both table.
Jan 06, 2016 10:45 AM|raghu_grdr|LINK
You can use Triggers.
Your requirement may be much Clear.
Jan 06, 2016 11:11 AM|VineetVikram|LINK
my both tables already have data, a job updates errors tables having date under error_trx_date column. i need to pull the current days data from errors table then match the error code of errors table to errors_test table and if number of errors(with particular
error code) exceeds the threshold in the error_test table then i need to send the bad return code
Jan 28, 2016 07:41 AM|Zhi Lv - MSFT|LINK
I suggest you could refer to the following articles to create Stored Procedure with Output Parameters.
If you want to get the number of the errors, you could use the COUNT function.