Sql Server Cursor Insert Into Query