Solved

varchar null or ''

Posted on 2010-09-21
4
408 Views
Last Modified: 2012-06-27
varchar internalsku1

if internalsku1 is null or internalsku1='' use 111
0
Comment
Question by:rgb192
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 33725349
isnull(nullif(internalsku1, ''), '111')
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33725399
You can also try the below sql


SELECT CASE WHEN internalsku1 IS NULL OR internalsku1 = '' THEN '111' END FROM TableName
0
 
LVL 12

Expert Comment

by:jagssidurala
ID: 33732108
Better to use like below.

Select      IsNull(NullIf(LTRIM(RTRIM(internalsku1)), ''), 111)
From      tableName
0
 

Author Closing Comment

by:rgb192
ID: 33762573
thanks
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question