Table design with NULL in column

  • Hello all,

    I have this design:

    ID    int IDENTITY   PRIMARY KEY

    Nr    int

    In the Nr-column I want unique identity numbers, OR NULL-values. How do I need to configure this column to get this done? Putting an index on this column is not enough, as it will not allow me to enter more than one row in which the Nr equals NULL.

    tia

     

    Hans

     

  • Check out this link for more info on this:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=9&messageid=157147#bm157159

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Thank you Old Hand,

    the VIEW solution will do just fine; any drawbacks known with this solution (performance or otherwise)?

     

    Hans

  • I've never used this solution - though I see no reason for any drawbacks - except, perhaps, for the ugly message that could be sent back to client apps - non-technical users might not understand what's happened.

    Regards

    Phil

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Ok Phil,

    thanks again, I'm definitly going to try the view-solution then.

    Admin/Moderator: consider issue closed.

    regards,

    Hans

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply