CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    Athens, Greece
    Posts
    1,094

    SQL Server UNIQUE constraint

    Hi,
    I want to create a constraint on a field.
    I need uniqueness as long as the field is not null (allow multiple nulls).
    How am I going to do this?
    Extreme situations require extreme measures

  2. #2
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210
    I believe you can't..
    you can create a triggers to handle this setuation..
    one trigger for insert and the other for update.And check if the data violates your rules.

  3. #3
    Join Date
    Apr 2003
    Location
    Athens, Greece
    Posts
    1,094
    Yes, it is true. The problem I'm having now is actually make this trigger work since I need to use dynamic SQL. I posted this in another thread.

    Thanx a lot

    Panayotis
    Extreme situations require extreme measures

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

Featured