• you could place GO statements between each command, but you still have to manually ignore the errors...makes it hard to determine which are "ignorable" errors and which are real.

    instead, consider checking for the object before you create it:

    IF NOT EXISTS(select 1 from sys.columns where name='Field1' and object_name(object_id) = 'Table1')

    ALTER TABLE Table1 ADD [Field1] nvarchar(4);

    IF NOT EXISTS(select 1 from sys.columns where name='Field2' and object_name(object_id) = 'Table1')

    ALTER TABLE Table1 ADD [Field2] nvarchar(2);

    IF NOT EXISTS(select * from sys.objects where name='Foo' and type_desc = 'PRIMARY_KEY_CONSTRAINT' and object_name(parent_object_id) = 'Table2')

    ALTER TABLE Table2 ADD CONSTRAINT Foo PRIMARY KEY ([ID])

    IF NOT EXISTS(select 1 from sys.columns where name='Field1' and object_name(object_id) = 'Table3')

    ALTER TABLE Table1 ADD [Field1] nvarchar(50);

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!