Results 1 to 2 of 2

Thread: Are nulls slow?

  1. #1
    Join Date
    Mar 2003
    Posts
    130

    Question Unanswered: Are nulls slow?

    I have several tables anywhere from 50,000 to 100,000 rows with about 100 columns in each that allow nulls. How bad will this affect performance (if any)?

    If it's significant, how can I replace nulls with zeros without doing it column by column? (100 columns will take too much time)

    thanks

  2. #2
    Join Date
    Jun 2003
    Posts
    269

    Thumbs up

    I dont think null will affect the perfomance.Below code will generate update statement for ur tables,columns which allow null values.Run this code, copy and paste the result to query analyser and execute.
    Code:
    select 'update '+TABLE_NAME+' set '+COLUMN_NAME+'=0 where '+COLUMN_NAME+' is null'
    from INFORMATION_SCHEMA.COLUMNS
    where IS_NULLABLE='YES'
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

Posting Permissions

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