if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fn_test]'))
begin
select 1
end if object_id(N'[dbo].[fn_test]') is not null
begin
select 2
end
请问这个2句sql语句(object_id)和 (select * from dbo.sysobjects where id = object_id())这个有区别吗
begin
select 1
end if object_id(N'[dbo].[fn_test]') is not null
begin
select 2
end
请问这个2句sql语句(object_id)和 (select * from dbo.sysobjects where id = object_id())这个有区别吗
if exists
(select * from dbo.sysobjects where id = object_id(N'[dbo].[fn_test]'))--加type类型
begin
select 1end --两种写法没有区别