I wrongly posted this in SQL Server 2005 so re-posting here as I couldn't move it. I'm running SQL Server 2014. I'm having trouble getting the right result from my stored procedure, I'm not going to post the code because I've messed around with it too much and I can't remember what I started with. What I'm trying to do is this:[code]If submitted username and password match a record in dbif EmailConfirmed = trueuser = 1 (activated)elseuser = -2 (not activated)elseuser = -1 (user invalid)end[/code]The table is called AspNetUsers, fields are as follows:IdUserNamePasswordHashEmailAddressEmailConfirmedNo matter how I amend the code it gives unexpected results. Please could you help with the code?
↧