Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-06-2009
Member
 
Join Date: Apr 2009
Posts: 102
SQL need to check null or empty string

Can any body tell me that how do i check in my Stored procedure if the information passed is null or empty in SQL, in order to insert the new value or need to keep the old one. Can any body tell me that how can i do it? Does any body knows about it? Kindly provide me the correct solution for the above issue.
Reply With Quote
  #2  
Old 18-06-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: SQL need to check null or empty string

According to me, i think you're facing with character fields, where you have an empty string that is different from a NULL value of a character field.

A NULL value represents the absence of a value for a record in a field (others softwares call it also a missing value).

An empty value is a "field-formatted" value with no significant data in it.
Reply With Quote
  #3  
Old 18-06-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: SQL need to check null or empty string

For that you need to follow the below steps mention.

Quote:
Create Table #Temp (column1 varchar(50))

INSERT INTO #Temp VALUES (NULL)

SELECT * FROM #Temp

UPDATE #TEMP
SET column1 = ''

SELECT * FROM #Temp
Reply With Quote
  #4  
Old 18-06-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: SQL need to check null or empty string

I think you can prepend AppraisalResponseHistory. in front of detail but that will be the same.

Detail is null or LEN(Detail) > 0 is checking the wrong thing it should be
Detail is null or LEN(Detail) = 0 -- null or length of 0
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "SQL need to check null or empty string"
Thread Thread Starter Forum Replies Last Post
How to replace a null string with blank cell in Microsoft Excel Eas!war MS Office Support 2 15-02-2012 05:52 PM
Does Null value refer to empty value in SQL? Chellam Software Development 3 07-01-2011 08:24 AM
Problem with a null string in java Rily Software Development 4 12-08-2010 10:23 AM
How to Check Null Value in C#? sivaranjan Software Development 4 04-02-2010 04:49 AM
How to check java string not null or blank Capper Software Development 4 30-07-2009 07:11 PM


All times are GMT +5.5. The time now is 03:54 AM.