Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Index definition

 Post Reply Post Reply
Author
Anders Gustavsson View Drop Down
New Member
New Member
Avatar

Joined: 11 Dec 2010
Posts: 3
Post Options Post Options   Quote Anders Gustavsson Quote  Post ReplyReply Direct Link To This Post Topic: Index definition
    Posted: 28 Apr 2016 at 2:14pm
I have a field in a table that allows null, and I want an unique index on that table that only should check for uniqueness on non-null values. In MS SQL this is done this way:

create unique nonclustered index myIndex
on myTable( myFieldName )
where myFieldName is not null;

If I set this up in Data Modeler, it generates a script with the standard

create uniqueindex myIndex on myTable(myFieldName)

but this doesn't work. Is there a way to trick DM to do it the right way?

/Anders
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2299
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 2016 at 9:26pm
Unfortunately no, there is no way to add such custom SQL for creating extra objects. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down