SqlServer判断表、列不存在则创建


一、表不存在则创建:

if not exists (select * from sysobjects where id = object_id('mytab')
and OBJECTPROPERTY(id, 'IsUserTable') = 1)
create table  mytab
(
   id int,
   age int ,
   name varchar(max),
   primary key (id,age)
)
go

二、列不存在则创建。

if not exists (select * from syscolumns where id=object_id('mytab') and name='columnname') alter table [mytab] add columnname nvarchar(max)

CentOS 7.6下宝塔面板 PHP7.2安装sqlsrv扩展

解决请求https://geo.datav.aliyun.com/areas_v3/bound/440000_full.json 返回403的问题

评 论
更换验证码