if ((select count(*) from dbo.TodoHistory) = 0)
    insert into dbo.TodoHistory (HistoryType, TodoID, ConnectionID, CreationDate, DueDate, Name, Priority, Data, UserInfoID, SecurityGroup, PrimaryTodoUsersID, ClosedDate, IsPrivate, CustomField1, CustomField2, CustomField3, ModifiedDate, ModifiedUsername, ModifiedLoggedUserName, EventProcessed)
    select N'I', ID, ConnectionID, CreationDate, DueDate, Name, Priority, Data, UserInfoID, SecurityGroup, PrimaryTodoUsersID, ClosedDate, IsPrivate, CustomField1, CustomField2, CustomField3, getutcdate(), ModifiedUsername, ModifiedLoggedUserName, 1 from dbo.Todo