if exists (select * from sys.sysobjects where id = object_id(N'dbo.UserInfo') and type = 'U')
    exec ('insert into dbo.UserSecurity
select ID, Name, UserType, IsAdministrator, IsEnabled, IsLockedOut, DataSourceID, Departments, SecurityKey, AccountSettings, CanAdd, CanDelete, CanEdit, CustomSecurity, CanAddCredentials, CanAddDataEntry, CanEditCredentials, CanEditDataEntry, CanDeleteCredentials, CanDeleteDataEntry, LastLockoutDate, FailedPasswordAttemptCount, FailedPasswordAttemptWindowStart, CreationDate, CreatedByUserName, CreatedByLoggedUserName, ModifiedDate, ModifiedUserName, ModifiedLoggedUserName from dbo.UserInfo');