I use SQL Azure and try to create nonclustered index
CREATE NONCLUSTERED INDEX IX_SyncNotNull ON MyTable
(IMEI, Sync1, Sync2, FieldA, FieldB, FieldC)
WHERE (Sync1 = 1 OR Sync2 = 1);
But I get an error:
Incorrect syntax near the keyword 'OR'.
I google and found, that no possible to use OR for index WHERE condition, but how to replace it?
I tried
CREATE NONCLUSTERED INDEX IX_SyncNotNull ON Device
(IMEI, Id, Name, DeviceModelId, Status, SyncVerizon, SyncSureMdm, CarrierId, LastConnectionDate)
WHERE (1 in (SyncVerizon, SyncSureMdm));
but it's also incorrect statement
ADDED
Found solution like:
WHERE CAST(SyncSureMdm AS INT) + CAST([SyncVerizon] AS INT) > 0
but will be this effectively, with type conversion?