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

  • You can do it in a single command:

    CREATE PROCEDURE dbo.GetExpirationValue

    @UserEmail VARCHAR(50)

    AS

    SELECT a.email, a.membershipexpiry,

    IsExpired = CASE WHEN a.membershipexpiry < GETDATE() THEN 1 ELSE 0 END

    FROM dbo.tbl_a a

    WHERE a.email = @UserEmail

    GO

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths