CREATE procedure [dbo].[CARFCN](@NBLC Varchar) returns int
as
Begin
Declare @CDLF INT
set @CDLF = (select count([*Downlink EARFCN]) from EutranInterNFreq$
where NodeB_Locell = @NBLC)
return @CDLF
End
问题1.此功能无法在select中使用。怎么用?
select cell.[*eNodeB Name],cell.[*eNodeB ID],cell.[*Cell Name], cell.
[Downlink EARFCN], Cell.[Nodeb Locell],
[dbo].CARFCN(CELL.[*eNodeB Name]) as NUM
from ais.dbo.cell$ CELL
LEFT JOIN ais.dbo.EutranInterNFreq$ InterN
on cell.[Nodeb Locell]= interN.[NodeB_Locell];
错误消息102,级别15,状态1,行7 'dbo'附近的语法不正确。我错了什么?
问题2 然后我尝试最小化问题我创建sql以调用如下。
select dbo.CARFCn('ABCRM_101') as numb; This return value 0 ????
但如果我打电话给查询,则答案是2
select count([*Downlink EARFCN]) from EutranInterNFreq$ where NodeB_Locell =
'ABCRM_101');
为什么这样以及如何解决?