Home Forums SQL Server 2008 SQL Server 2008 - General how to write a stored procedure to check if the members membership has expired RE: how to write a stored procedure to check if the members membership has expired

  • sanjay.dakolia (11/24/2012)


    i have a table named users where i have two three column userid, email, membershipexpiry

    i want to write a stored procedure tat will take email as a input from the front hand and compare the current date with the date stored int the membershipexpiry column in the database its should be less then or equal to the current date if the membership hasn't expired it should return 1 or else 0.

    plz help me

    thanks in advance

    sanjay

    Sanjay...

    It looks like you're really new to SQL Server so I have to warn you... be careful with any script that does a DROP in the code unless it's dropping a table whose name starts with a "#" sign. If you leave out any of the code during a run, you could end up dropping the real "Users" table by mistake.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)