Syntax help needed for ALTER

  • Hello,

    I need syntax help for an ALTER statement. The ALTER Statement is an attempt to change the data type of several fields to bit, and looks like this:

    alter table tblRCStudentGrades

    alter column

    SPpeQ1 bit null, SPpeQ2 bit null, SPpeQ3 bit null, SPpeQ4 bit null,

    SPlsQ1 bit null, SPlsQ2 bit null, SPlsQ3 bit null, SPlsQ4 bit null,

    SPrpQ1 bit null, SPrpQ2 bit null, SPrpQ3 bit null, SPrpQ4 bit null,

    SPdcQ1 bit null, SPdcQ2 bit null, SPdcQ3 bit null, SPdcQ4 bit null,

    SPot1Q1 bit null, SPot1Q2 bit null, SPot1Q3 bit null, SPot1Q4 bit null,

    SPgtQ1 bit null, SPgtQ2 bit null, SPgtQ3 bit null, SPgtQ4 bit null,

    SPeiQ1 bit null,SPeiQ2 bit null, SPeiQ3 bit null, SPeiQ4 bit null,

    SPecQ1 bit null, SPecQ2 bit null, SPecQ3 bit null, SPecQ4 bit null,

    SPalQ1 bit null, SPalQ2 bit null, SPalQ3 bit null, SPalQ4 bit null,

    SPtIQ1 bit null, SPtIQ2 bit null, SPtIQ3 bit null, SPtIQ4 bit null,

    SPot2Q1 bit null, SPot2Q2 bit null, SPot2Q3 bit null, SPot2Q4 bit null

    I am getting a syntax error on the first line of fields. I've tried several things to make this work, no luck. Its one of these simple things, but I don't have an example of altering multiple fields like this.

    Thanks,

    CSDunn

  • You can add or drop many columns at a time from a table. However you cannot alter more than one column in a single ALTER TABLE statement. Use multiple statements instead. Put them in one transaction if you need to.

  • Thanks for your help. cd.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply