Please can the SQL code below be interpreted
IF @xMatchCriteria='MATCH12'
BEGIN
IF EXISTS (Select * from #InsightData where (EmailAddress=@xDCPEmailAddress ) )
BEGIN
SET @xTestMatchCriteria = @xMatchCriteria;
SELECT @xCRMCustomerId=CustomerId, @xCRMDcpCustomerId=DcpCustomerId, @xCRMPortalCustomerID=PortalCustomerID,@xCRMDcpID=DcpID, @xCRMCardNumber=CardNumber, @xCRMEmailAddress=EmailAddress, @xCRMfirtLetterFirstName=firtLetterFirstName,
@xCRMLastName=Surname,@xCRMAddressLine1=AddressLine1, @xCRMPostCode=PostCode
FROM #InsightData
where (EmailAddress=@xDCPEmailAddress )
END
ELSE
BEGIN
SET @xTestMatchCriteria='No'+@xMatchCriteria;
END
END



Please can the SQL code below be interpreted IF @xMatchCriteria='MATCH12' BEGIN I..

Answer / Sandeep Kumar Gautam

The given SQL code is a block of T-SQL (Transact-SQL) code written for Microsoft SQL Server. When executed, it checks if an email address exists in the table #InsightData. If it does, it sets a variable @xTestMatchCriteria to the value of the matching criteria (@xMatchCriteria). If not, it sets @xTestMatchCriteria to 'No' followed by @xMatchCriteria. It then selects and assigns various customer related data from the table #InsightData into several variables based on the matching email address.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

Is sql and mysql same?

1 Answers  


Do while loop in mysql procedure?

1 Answers  


Can a table have multiple primary keys?

1 Answers  


What is the return type of mysqli_query?

1 Answers  


Is mysql from oracle?

1 Answers  


What does myisamchk do?

1 Answers  


How do I stop a mysql command?

1 Answers  


How to write after insert event update trigger on the same table in mysql?

1 Answers  


how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...

1 Answers  


How do I clear a mysql database?

1 Answers  


Please suggest me any course and institute which provide training on the below skills. • Knowledge of data extraction concepts and tools • QMF (query management facility)queries • Experience and expertise in QMF queries • Excellent ability to write, read, and interpret QMF queries against the Source Data Warehouse base level (daily and monthly) and month-end affinity comp tables • RDBMS & ER • Knowledge of Relational Databases (RDBMS) and Entity Relationship (ER) Diagrams • SOURCE Data Warehouse • Experience and expertise in Source Data Warehouse or data warehouses on the mainframe. • MS SQL Server • Experience in MS SQL Server • Excellent skill in writing/interpreting SQL queries and running Data Transformation Services (DTS) or open query packages. • Knowledge of writing/interpreting Visual Basic code.

1 Answers  


Does mysql need a server?

1 Answers  


Categories