增加字段
alter table tablename  add colname 字段类型
增加表
create table tablename (col1 char(10)....)
增加不影响访问的

解决方案 »

  1.   

    例:
    if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[t]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
      CREATE TABLE t (...)
    GOif not exists (select * from dbo.syscolumns where id = object_id(N'[dbo].[t]') and name = 'col')
      ALTER TABLE t ADD col varchar(10) null
    GO
      

  2.   

    alter table tablename  add colname1 字段类型
    alter table tablename  add colname2 字段类型
    alter table tablename  add colname3 字段类型
    .
    .
    .
    .
    .
    alter table tablename  add colnameN 字段类型
      

  3.   

    注意不要not null,会死得比较难看的,还好,不算非常难看。
    如果非要not null,就先插入值,再改成not null。
    具体咋做,看联机帮助吧。