Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

varchar null or ''

varchar internalsku1

if internalsku1 is null or internalsku1='' use 111
0
rgb192
Asked:
rgb192
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
isnull(nullif(internalsku1, ''), '111')
0
 
vdr1620Commented:
You can also try the below sql


SELECT CASE WHEN internalsku1 IS NULL OR internalsku1 = '' THEN '111' END FROM TableName
0
 
jagssiduralaCommented:
Better to use like below.

Select      IsNull(NullIf(LTRIM(RTRIM(internalsku1)), ''), 111)
From      tableName
0
 
rgb192Author Commented:
thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now