34,590
社区成员
发帖
与我相关
我的任务
分享
会不会在列上已经创建了主键之类?
if object_id('tb') is not null
drop table tb
go
create table tb(c int primary key)
insert tb values(3)
insert tb values(14)
insert tb values(5)
insert tb values(60)
insert tb values(1)
insert tb values(54)
select * from tb
----------------
c
-----------
1
3
5
14
54
60
if object_id('tb') is not null
drop table tb
go
create table tb(c int)
insert tb values(3)
insert tb values(14)
insert tb values(5)
insert tb values(60)
insert tb values(1)
insert tb values(4)
select * from tb
/*
c
-----------
3
14
5
60
1
4
(6 row(s) affected)
*/