While reviewing control procedure templates I continuously keep seeing trigger template in which people declare variables and set them. It would really be helpful if we could automatically check trigger templates for the use of variables, whilst not using a cursor.
Variables are required when using a cursor. In nearly all other scenario's triggers do not require the use of variables. Most times, that these variables are being set, this will lead to errors when the inserted contains more then 1 record.
Therefor I would like to suggest we add a validation (or an option within the code review screen) to check trigger templates for this mistake. This would significantly lower the chance that developers will make this mistake.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.