--- On Wed, 12/26/07, liuzg2(at)21cn(dot)com <liuzg2(at)21cn(dot)com> wrote: > but i do not want use function or procedure Are you sure? I thought that: DECLARE IF --control structures @@rowcount where only usable in a store procedure. Am I incorrect, or are these keywords accessible from the SQL prompt? Regards, Richard Broersma Jr.