if not exists (select * from sysindexes

where

id=object_id(‘OfflineCfg’) and name=‘IX_USER’)

begin

CREATE NONCLUSTERED INDEX [IX_USER]

ON [dbo].[OfflineCfg] ([UserId])

end

Advertisements