Results 1 to 7 of 7

Thread: RESOLVED Sql Server Sql Question

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    RESOLVED Sql Server Sql Question

    In SQL SERVER how would I write a SQL statement to set a column of null values to an emptry string?

    so that any value in a column that is <null> would change to ""
    Last edited by kleinma; Mar 7th, 2002 at 08:20 AM.

  2. #2
    rickm
    Guest
    update tablename
    set columnname = ''
    where samecolumnname is null

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by rickm
    update tablename
    set columnname = ''
    where samecolumnname is null
    I tried that but it gave me an error

  4. #4
    rickm
    Guest
    Originally posted by kleinma


    I tried that but it gave me an error
    Did you replace the tablename with the actual tablename and the columnnames with the actual columnnames? What was the error.

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    lol ya...

    I actually tried that before i posted this.. i am not at work anymore.. i can post the exact error tomorrow..

    it was something like can't insert value try using a space instead or something like that.. and it is sql server 2000

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    By the way.. when i said i wanted to insert "" i mean i want to insert a zero length string.. i don't know why i didn't say that from the start..

  7. #7

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    ok you have to insert ' ' into the table... that is seen as a zero length string to SQL server... for some reason it needs the space...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width