【发布时间】:2018-02-02 13:23:26
【问题描述】:
而不是这个:
-- Method call
SELECT @FunctionResult = DWH_Staging.adm.SalesPlanExists(@Year, @Month, @CountryID, @Type)
我想用这样的东西:
DECLARE
@TestedDatabase = 'DWH_Staging',
@TestedSchema = 'adm',
@TestedObject = 'SalesPlanExists'
DECLARE @sql NVARHCAR(4000) = '@TestedDatabase+'.'+@TestedSchema+'.'+@TestedObject (@Year, @Month, @CountryID, @Type)'
-- Method call
SELECT @FunctionResult = @sql
提示将不胜感激。
【问题讨论】:
-
你到底想达到什么目标,什么是行不通的?
-
调用
sp_executesql时使用OUTPUT变量stackoverflow.com/questions/803211/…
标签: sql-server tsql dynamic-sql