• And John missed the part where OH_Message doesn't expects parameters and you're sending parameters. You're not using @Stud_id which is the base of your cursor and you have a begin with no corresponding end.

    What are you trying to do? Maybe we can help to simplify the logic and correct the code.

    Please read the article linked in my signature to get better help.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2