Hi
I was wondering if someone could help me. I'm trying to test whether an email is in my mailing list. If it is, I want the database to return a value of 1, else 0. Please see SP attached
USE [Database]
GO
/****** Object: StoredProcedure [dbo].[MailingListSignUp] Script Date: 10/08/2014 16:25:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[MailingListSignUp]
@EmailAddress nvarchar(256)
AS
BEGIN
IF EXISTS(SELECT * FROM MailingList WHERE EmailAddress = @EmailAddress)
BEGIN
UPDATE MailingList
SET Active = 1
WHERE EmailAddress = @EmailAddress
RETURN (1)
END
ELSE
BEGIN
INSERT INTO MailingList (EmailAddress, Active, SignedUpDate)
VALUES (@EmailAddress, 1, GETDATE())
RETURN(0)
END
END
Now, I have created a Mailing Class with a method that returns a bool if t ...
Go to the complete details ...