Donate

Check If T-SQL Field Value Is A UniqueIndentifier In Select Case Statement

In the event that you need to check a T-SQL field value if it's a GUID or UniqueIdentifier, the same procedure is used in applying the logic in a where clause.
SELECT 
    CartObjectID,
 CartName,
 CartQuantity,
CASE 
 When TDD.FieldData like REPLACE('00000000-0000-0000-0000-000000000000', '0', '[0-9a-fA-F]') Then 
 (
  Select CartValue From tblCartList where ListID = TDD.FieldData
 ) 
ELSE TDD.FieldData
END As FieldData

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input