Ah, now I see. You cannot use an IF construct with an INSERT statement. Look in BOL for INSERT; it must be INSERT INTO....VALUES or INSERT INTO.....SELECT.
John Rowan
======================================================
======================================================
Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden