declare @ID bigint
if exists (select @ID=ID
from dbo.T_D_TA_WareHouseIn
where
[email protected] and
[email protected] and
[email protected] and
[email protected] and
UseFlag= ' ')
[email protected],赋值的时候不能和exists共用还是怎么回事啊,帮帮忙啊
------解决方案--------------------
declare @ID bigint
select @ID=ID
from dbo.T_D_TA_WareHouseIn
where
[email protected] and
[email protected] and
[email protected] and
[email protected] and
UseFlag= ' ')
if @ID is null then print '不存在 ' else print cast(@ID as varchar)