111,126
社区成员
发帖
与我相关
我的任务
分享
alter procedure pr_Test
as
begin
if exists (select * from sysobjects where name = 'a' and type = 'u')
begin
declare @cols int
select @cols = count(1) from sysobjects o
inner join syscolumns c on o.id = c.id
where o.type = 'u' and o.name='a'
if(@cols <> 3)
begin
alter table test2 add a int
alter table test2 add b int
alter table test2 add c int
end
select 1
end
else
begin
select 0
end
end
select *
from sysobjects
where xtype='U' and name='你要找的表名'