Cursor Help

  • Hi Guys,

    Here again, This Cursor and Procedure runs fine with no Problem, if i schedule in morning around 5:30am.

    Now i have question is how i can receive everyday how many SID are not inserted or inserted through

    this way, Below is my Sample codes that i created. My question is where i can insert this code.

    Inside the Cursor or somewhere? and how i can get the list of all SID.

    Here is the code.

    if(isnull(@SampleId,0)<>0)

    begin

    set @ImportanceBody = 'High'

    set @MessageSubject = 'Alert!Missing SID!!!!'

    set @MessageBody = 'Hi

    '

    set @MessageBody = 'Please check Why these SID are not inserted.

    ' + CONVERT(varchar,@Date,101) + ' at ' + CONVERT(varchar,@Date,108) +'

    '

    set @MessageBody = @MessageBody + 'Thanks,

    Administrator'

    end

    EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Floads',

    @recipients = 'myemailaddress',

    @subject = @MessageSubject,

    @body = @MessageBody,

    @body_format = 'HTML',

    @Importance = @ImportanceBody;

    Thank You.

  • rocky_498 (9/21/2012)


    Hi Guys,

    Here again, This Cursor and Procedure runs fine with no Problem, if i schedule in morning around 5:30am.

    Now i have question is how i can receive everyday how many SID are not inserted or inserted through

    this way, Below is my Sample codes that i created. My question is where i can insert this code.

    Inside the Cursor or somewhere? and how i can get the list of all SID.

    Here is the code.

    if(isnull(@SampleId,0)<>0)

    begin

    set @ImportanceBody = 'High'

    set @MessageSubject = 'Alert!Missing SID!!!!'

    set @MessageBody = 'Hi

    '

    set @MessageBody = 'Please check Why these SID are not inserted.

    ' + CONVERT(varchar,@Date,101) + ' at ' + CONVERT(varchar,@Date,108) +'

    '

    set @MessageBody = @MessageBody + 'Thanks,

    Administrator'

    end

    EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Floads',

    @recipients = 'myemailaddress',

    @subject = @MessageSubject,

    @body = @MessageBody,

    @body_format = 'HTML',

    @Importance = @ImportanceBody;

    Thank You.

    I'm sorry, but I'm lost. This email isn't part of your original post. How about you provide the story, the whole story, and nothing but the story. It is hard to provide a good answer when we don't have all the informatiion.

  • OMG I AM SO SORRYYYYY, I totally forgot there is page 2nd. I just implement your code its work fine, Again i am so

    sorry for this Confusion and Great Appreciate.

    Good WOrk Lynn Pettis!

  • rocky_498 (9/21/2012)


    OMG I AM SO SORRYYYYY, I totally forgot there is page 2nd. I just implement your code its work fine, Again i am so

    sorry for this Confusion and Great Appreciate.

    Good WOrk Lynn Pettis!

    Thank you for the feedback. Glad to hear that it is working for you.

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply