if not exists(select * from sys.indexes where name = 'IX_ConnectionState_UserID' AND object_id = object_id('dbo.ConnectionState'))
	create nonclustered index IX_ConnectionState_UserID on dbo.ConnectionState (UserID);