boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

How to use CASE statement to set a variable value in SQL Server?

Updated on     Kisan Patel

This tutorial will show you how to use CASE statement to set a variable value in SQL Server?

DECLARE @cId  varchar(55)
SET @cId = 'ALFKI'
DECLARE @isExists varchar(55)
SET @isExists =
	CASE
	       WHEN EXISTS (SELECT CustomerID FROM Customers
			WHERE CustomerID = @cId)
			THEN 'Customer detials exists.'
				WHEN EXISTS (SELECT Region FROM Customers
				WHERE CustomerID = @cId)
				THEN 'Customers Details Exists but Region do not'
		ELSE
		'N/A'
		END;
print @isExists

In above case, the value of @cId is ‘ALFKI’ that exists in the Customers table and the value of the
@isExists variable is set to ‘Customer detials exists’.

saer

sawe

Na


SQL Server

Leave a Reply