dbo.spCCPSetSocialNetworkInfo

Object type: Stored Procedure (MS-SQL)
Parent: CustomerDBSQL

SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: www.allshore.us -- Last update: 9/8/2011 -- Description: This procedure will return the User Information based upon [Call ltr] -- ============================================= CREATE PROCEDURE [dbo].[spCCPSetSocialNetworkInfo] ( @CallLtr VARCHAR(40), @SocialNetworkFacebook VARCHAR(255), @SocialNetworkTwitter VARCHAR(255), @SocialNetworkYouTube VARCHAR(255), @SocialNetworkInstagram VARCHAR(255), @RequestEmail VARCHAR(255), @ContactPhone VARCHAR(15) ) AS BEGIN DECLARE @SocialNetworkFacebookEnabled AS bit DECLARE @SocialNetworkTwitterEnabled AS bit DECLARE @SocialNetworkYouTubeEnabled AS bit DECLARE @SocialNetworkInstagramEnabled AS bit DECLARE @RequestEmailOnPlayer AS bit IF(len(@SocialNetworkFacebook) <> 0) SET @SocialNetworkFacebookEnabled = 1 ELSE SET @SocialNetworkFacebookEnabled = 0 IF(len(@SocialNetworkTwitter) <> 0) SET @SocialNetworkTwitterEnabled = 1 ELSE SET @SocialNetworkTwitterEnabled = 0 IF(len(@SocialNetworkYouTube) <> 0) SET @SocialNetworkYouTubeEnabled = 1 ELSE SET @SocialNetworkYouTubeEnabled = 0 IF(len(@SocialNetworkInstagram) <> 0) SET @SocialNetworkInstagramEnabled = 1 ELSE SET @SocialNetworkInstagramEnabled = 0 IF(len(@RequestEmail) <> 0) SET @RequestEmailOnPlayer = 1 ELSE SET @RequestEmailOnPlayer = 0 UPDATE Stations SET SocialNetworkFacebook = @SocialNetworkFacebook, SocialNetworkFacebookEnabled = @SocialNetworkFacebookEnabled, SocialNetworkTwitter = @SocialNetworkTwitter, SocialNetworkTwitterEnabled = @SocialNetworkTwitterEnabled, SocialNetworkYouTube = @SocialNetworkYouTube, SocialNetworkYouTubeEnabled = @SocialNetworkYouTubeEnabled, SocialNetworkInstagram = @SocialNetworkInstagram, SocialNetworkInstagramEnabled = @SocialNetworkInstagramEnabled WHERE [CALL LTR] = @CallLtr UPDATE player SET RequestEmail = @RequestEmail, RequestEmailOnPlayer = @RequestEmailOnPlayer WHERE [CALL LTR] = @CallLtr -- added 2015-07-08 by RADU DECLARE @mpID INT SET @mpID = (SELECT id FROM MobilePlayer WHERE [CallLTR] = @CallLtr) IF @mpID IS NULL BEGIN INSERT INTO MobilePlayer (CallLTR, ContactPhone) VALUES (@CallLtr, @ContactPhone) END ELSE BEGIN UPDATE MobilePlayer SET ContactPhone = @ContactPhone WHERE [CallLTR] = @CallLtr END SELECT @@ROWCOUNT END GO