Solved

varchar null or ''

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

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

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

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…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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 …

785 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