Sql Server Cursor Insert Into Table Where Condition