• ssurekha2000 (7/15/2013)


    i have a int column as Custid

    initally value is balnk.

    but i have set the default value when creating the field as 0

    i need to increment the max Custid value

    but if its null i need it be 0 so incrementing it would be 1

    select isnull(Custid,0)+1 as ID from TABLE1

    i have the Custid field blank with defualt value as 0

    but when i use the abobe query i dont get 1

    select isnull(Custid,0) as ID from TABLE1 i dont get 0

    Can you provide DDL and sample data so that I can see what your source data looks like? See the link in my signature for details of how to do this.

    Note that there is (potentially) a difference between 'NULL' and 'blank'.

    And still you have not asked a question.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.