0

I want to update Data_type where Data_Type contains Null or strings except D if there is any string how could i code it

Update Table_Name
Set Data_Type='D'
Where Data_type is Null 
   or Data_type = ' ' or like Data_type %[A-C]% or Data_Type %[e-z]%
Go
--

1 Answer 1

1

your syntax is wrong. Should be

Update Table_Name
Set    Data_Type = 'D'
Where  Data_Type <> 'D'
and    src_hm    <> 1
and   (
       Data_type is Null 
or     Data_type = ' ' 
or     Data_type like %[A-C]% 
or     Data_Type like %[e-z]%
      )
Sign up to request clarification or add additional context in comments.

1 Comment

Cool thanks man and if i want to put this into procedure if Data_type <> D then update and src_hm <>1 then update how can i code this ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.