使用 N 前缀的多个值

使用 N 前缀的多个值

我需要在@RefValue 参数中放置多个值以加快结果:

我试过了:
@RefValue = N'204' --205 '
但是它只返回了寄存器 204 的值。

命令:

DECLARE @return_value int

EXEC @return_value = [dbo].[LOG_ListTab_Key_SP]
@Tab = N'CAD_USERS',
@RefField = N'usucod',
@RefValue = N'204'

SELECT 'Return Value' = @return_value

逻辑LOG_ListTab_Key_SP:

deallocate cp
    set @sel = @sel + ' FROM [dbo].[log_tab] with (nolock) where logtab = '+ char(39)+ @tab + char(39) + ' and logReg.value(' + char(39) 
    set @sel = @sel +'(//@' + @filter + ')[1]' + char(39) + ', ' + char(39) + @filterTip + char(39) + ') = ' + char(39) +  @RefValue  + char(39)
    set @sel = @sel + ' union all '  
    set @sel = @sel + ' Select 999999999 as logId, '+ char(39)+ @Tab + char(39) +' as logTab, '+ @cmpDat + ' as logDat, ''Actual'' as logHost, '
    set @sel = @sel + char(39)+ 'A' + char(39) +' as logOpe, * from ' + @Tab + ' with (nolock)'
    set @sel = @sel + ' where '+ @filter + ' = '+ @RefValue  
    set @sel = @sel + ' order by logId;'
    execute (@sel)
    Return

如何在@RefValue 参数中放置多个值?

相关内容