Solved

varchar null or ''

Posted on 2010-09-21
4
405 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now