Results 1 to 4 of 4

Thread: SQL need to check null or empty string

  1. #1
    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.

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: SQL need to check null or empty string

    For that you need to follow the below steps mention.

    Create Table #Temp (column1 varchar(50))

    INSERT INTO #Temp VALUES (NULL)

    SELECT * FROM #Temp

    UPDATE #TEMP
    SET column1 = ''

    SELECT * FROM #Temp

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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

Similar Threads

  1. Replies: 2
    Last Post: 15-02-2012, 05:52 PM
  2. Does Null value refer to empty value in SQL?
    By Chellam in forum Software Development
    Replies: 3
    Last Post: 07-01-2011, 08:24 AM
  3. Problem with a null string in java
    By Rily in forum Software Development
    Replies: 4
    Last Post: 12-08-2010, 10:23 AM
  4. How to Check Null Value in C#?
    By sivaranjan in forum Software Development
    Replies: 4
    Last Post: 04-02-2010, 04:49 AM
  5. How to check java string not null or blank
    By Capper in forum Software Development
    Replies: 4
    Last Post: 30-07-2009, 07:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,038,923.61465 seconds with 17 queries