Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Query SqlServer2003 stored procedure

Query SqlServer2003 stored procedure

Scheduled Pinned Locked Moved Database
database
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vivek_r
    wrote on last edited by
    #1

    Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore

    _ C 2 Replies Last reply
    0
    • V vivek_r

      Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      You can use IF condition in your stored procedure.

      Best Regards, Apurva Kaushal

      1 Reply Last reply
      0
      • V vivek_r

        Hi, I am working on a forgot password module in which i have to send the mail having password to the user.I am using UserID,Email,IsApproved,IsVisible fields in my table.The module is working fine with sending mail on the basis of existing email of user.But i have to apply checks on the stored procedure that if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail. I am using SqlServer2003 stored procedure. Vivek Rathore

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        vivek_r wrote:

        I am using SqlServer2003 stored procedure

        I very much doubt that.

        vivek_r wrote:

        I am working on a forgot password module in which i have to send the mail having password to the user

        Personally, I think that is a bad idea. You should never store the password in a form where it can be sent via email. It is better to store the password as a salted hash which means that it can never be retrieved. Then, if the user forgets the password, it has to be regenerated.

        vivek_r wrote:

        if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail.

        SELECT columns WHERE Email = @email AND IsApproved = 1 The logic is very simple. You have stated that if IsApproved is 0 then do not send the email, and IsVisible is unimportant (reread what you wrote if you think that is an incorrect interpretation)

        IsVisible IsApproved Send Email
        0 0 No
        0 1 Yes
        1 0 No
        1 1 Doesn't say: likely yes


        Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

        V 1 Reply Last reply
        0
        • C Colin Angus Mackay

          vivek_r wrote:

          I am using SqlServer2003 stored procedure

          I very much doubt that.

          vivek_r wrote:

          I am working on a forgot password module in which i have to send the mail having password to the user

          Personally, I think that is a bad idea. You should never store the password in a form where it can be sent via email. It is better to store the password as a salted hash which means that it can never be retrieved. Then, if the user forgets the password, it has to be regenerated.

          vivek_r wrote:

          if the IsApproved and IsVisble fields are set to 0 by admin then the password would not be sent to the user and if IsApproved is 0 and IsVisible is 1 then do not send mail and if IsApproved is 1 and IsVisible is 0 then send mail.

          SELECT columns WHERE Email = @email AND IsApproved = 1 The logic is very simple. You have stated that if IsApproved is 0 then do not send the email, and IsVisible is unimportant (reread what you wrote if you think that is an incorrect interpretation)

          IsVisible IsApproved Send Email
          0 0 No
          0 1 Yes
          1 0 No
          1 1 Doesn't say: likely yes


          Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

          V Offline
          V Offline
          vivek_r
          wrote on last edited by
          #4

          Dear Colin, You are saying very much right that the IsVisible field does not mean at all. A short while ago i got the same answer as urs was. Thank you very much for your suggestion. Thanks and Regards Vivek Rathore. Vivek Rathore.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups