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

How To Insert Or Add Emojis In Microsoft Teams Status Message

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid