CREATE TABLE xsbnew2
(
sh INT PRIMARY KEY IDENTITY(1623003121,1) not null,
xm varchar(40) not null,
email varchar(50) check(email like '%@%'),
dz varchar(50) default('中国云南')
)
改成这样试试
use netbar
go
create table xsbnew
(
xh int primary key identity(1623003121,1) not null,
xm varchar(40) not null,
email varchar(50) check(email like '%@%'),
dz varchar(50) default('中国成都')
)
go
insert into xsbnew(xm,email,dz)
values('晏祥均','lire@163.com','纽约')
select * from xsbnew
insert into xsbnew(xm,email,dz)
values('小诺','xn@google@cn','俄罗斯')
select * from xsbnew
insert into xsbnew(xm,email,dz)
values('得到','dd@souhu.com',default)
insert into xsbnew(xm,email,dz)
select '小妮','xn@xinlang.com','白云山'union
select '小荔','xl@tengxun.com','青青谷'union
select '小烛','xz@fenghuang.com','依稀镇'
create table xsbnew1
(xm varchar(50),email varchar(50),dz varchar(50))
select * from xsbnew1
insert into xsbnew1(xm,email,dz)
select xm,email,dz
from xsbnew
create table xsbnew2
(
xh int primary key identity(1623000000,1) not null,
xm varchar(40) not null,
email varchar(50) check(email like '%@%'),
dz varchar(50) default('中国云南')
)
insert into xsbnew2(xm,email,dz)
select xm,email,dz
from xsbnew where xh <= 1623003125
select identity(int,1623003121,1) as xh,email,dz
into xsbnew3
from xsbnew
select * from xsbnew3
select identity(int,1623003121,1) as xh,email,dz
into xsbnew4
from xsbnew where 1>5
select * from xsbnew1
update xsbnew set email='xn@google.cn'
where xh=1623003122
use netbar
go
create table xsbnew
(
xh int primary key identity(1623003121,1) not null,
xm varchar(40) not null,
email varchar(50) check(email like '%@%'),
dz varchar(50) default('中国成都')
)
go
insert into xsbnew(xm,email,dz)
values('晏祥均','lire@163.com','纽约')
select * from xsbnew
insert into xsbnew(xm,email,dz)
values('小诺','xn@google@cn','俄罗斯')
select * from xsbnew
insert into xsbnew(xm,email,dz)
values('得到','dd@souhu.com',default)
insert into xsbnew(xm,email,dz)
select '小妮','xn@xinlang.com','白云山'union
select '小荔','xl@tengxun.com','青青谷'union
select '小烛','xz@fenghuang.com','依稀镇'
create table xsbnew1
select * from xsbnew1
insert into xsbnew1(xm,email,dz)
select xm,email,dz
from xsbnew
create table xsbnew2
(
xh int primary key identity(1623000000,1) not null,
xm varchar(40) not null,
email varchar(50) check(email like '%@%'),
dz varchar(50) default('中国云南')
)
select * from xsbnew3
insert into xsbnew2(xm,email,dz)
select xm,email,dz
from xsbnew where xh <= 1623003125
select identity(int,1623003121,1) as xh,email,dz
into xsbnew3
from xsbnew
select identity(int,1623003121,1) as xh,email,dz
into xsbnew4
from xsbnew where 1>5
select * from xsbnew1
updata xsbnew set email='xn@google.cn'
where xh=1623003122
data from xsbnew1
truncate table xsbnew1
麻烦大神看看