if exists(select * from sys.indexes i where i.object_id = object_id('AKUZ.T_EMDR_MESSAGE', 'U') and i.name = 'IX_T_EMDR_MESSAGE_RegistrationState_INCLUDE')
	DROP INDEX IX_T_EMDR_MESSAGE_RegistrationState_INCLUDE ON AKUZ.T_EMDR_MESSAGE;
go
CREATE INDEX [IX_T_EMDR_MESSAGE_RegistrationState_INCLUDE] ON [AKUZ].[T_EMDR_MESSAGE] ( [RegistrationState], [WhereToSend] ) INCLUDE ( [CardNote], [MessageID], [ReplaceableDocVersion], [ReplaceableEmdrId] , [CardNote_remd], [CardNote_vimis], [CardNote_iemk]) WITH (FILLFACTOR=95, SORT_IN_TEMPDB=ON, MAXDOP = 0);
GO
if exists(select * from sys.indexes i where i.object_id = object_id('AKUZ.T_EMDR_MESSAGE', 'U') and i.name = 'IX_T_EMDR_MESSAGE_RegistrationState')
	DROP INDEX IX_T_EMDR_MESSAGE_RegistrationState ON AKUZ.T_EMDR_MESSAGE;
go