zoukankan      html  css  js  c++  java
  • 修改以及设计好的表

    1.修改表字段

    use EntranceVista;
    alter table Ry_Stay_Info alter column wza nvarchar(50) 
    alter table Ry_Stay_Info alter column wzb nvarchar(50)

    2.添加主键

    添加主键之前先要让该字段不能为空

    use EveryTouch;
    alter table FP_TB_Department alter column ID int not null 
    alter table FP_TB_Department add constraint PK_DEPARTMENT primary key (ID)

    3.添加自增长

    如果一个列已经有主键,要先删除主键,再删除字段,再添加

       alter table FP_TB_Department drop constraint PK_DEPARTMENT 
      alter table FP_TB_Department drop column ID
      alter table FP_TB_Department add ID int identity(1,1) constraint PK_DEPARTMENT primary key (ID)

     4.修改默认值

    alter table BBS_VoteDetail_TB add default newid() for VoteDetailID

    删除默认值

    alter table Service_TeacherInfo drop Constraint DF__tmp_ms_xx__Appro__737017C0
      alter table ChannelBargainSecond drop Constraint DF__ChannelBa__Updat__15FB0545
      alter table ChannelBargainSecond drop column UpdateTime

     5.添加字段

      alter table [CJGreenWay].[dbo].[T_OrderApprove] add [State] int null
      alter table ChannelBargainSecond add UpdateTime datetime null default getdate();
      alter table ChannelBargainSecond add IsDelete int not null default 0;
      alter table ChannelBargainSecond add CreateUser nvarchar(20)  null;
  • 相关阅读:
    dir 函数
    模块的 __name__
    from..import 语句
    pass
    可变参数
    python 中的一点新知识
    Numpy中的一点小知识
    使用ipython %matplotlib inline
    numpy.random.rand
    Python:numpy中shape和reshape的用法
  • 原文地址:https://www.cnblogs.com/hongdada/p/4500539.html
Copyright © 2011-2022 走看看