当前位置: 代码迷 >> Sql Server >> 原来的表新增物理列,速度。解决方案
  详细解决方案

原来的表新增物理列,速度。解决方案

热度:41   发布时间:2016-04-27 14:46:06.0
原来的表新增物理列,速度。
表A
col01 , col02


if not exists (select name from syscolumns where id= object_id('M1112') and name= 'Col003') 
加入列 Col003


 表A
col01 , col02 , col03
 

------解决方案--------------------
if not exists (select name from syscolumns where id= object_id('M1112') and name= 'Col003') 
begin
alter table M1112 add Col003 varchar(20);
end
------解决方案--------------------
+1
探讨
if not exists (select name from syscolumns where id= object_id('M1112') and name= 'Col003')
begin
alter table M1112 add Col003 varchar(20);
end

------解决方案--------------------
SQL code
alter table tbname add colname int/varchar/...
  相关解决方案