• It could be that you are using a control that does its own sorting or just doesn’t use the order of the rows that it got, but the queries should return the rows with null values being the last. The code bellow has a small demo that shows it (you should run it from SQL Server management studio).

    declare @DemoTbl table (i int identity(1,1), ch char(1))

    insert into @DemoTbl (ch)

    select 'b'

    union all select null

    union all select 'a'

    union all select null

    union all select 'c'

    union all select 'd'

    select *

    from @DemoTbl

    order by case when ch is null then 1 else 0 end, ch

    select *

    from @DemoTbl

    order by ISNULL(ch,'zzzz'), ch

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/