1.i声明如下:
declare @sql6 nvarchar(max)=''
--RETURN
SET @defs = N'
@groupCode VARCHAR(128),
@zScore float=''.95''';
set @sql6=@sql6+'BUNCH OF CODE >8000'
PRINT CAST(@SQL6 AS NTEXT)
EXEC sp_executesql @SQL6, @defs,
@GroupCode = @GroupCode,
@zScore = @zScore
语句PRINT CAST(@ SQL6 AS NTEXT)是否应打印无限数量的字符?
我的代码在下面有语法错误:
print语句打印:
SELECT
P.SourceCode,
P.TreatmentID,
P.ProductID,
P.OptimizationGroupID,
P.TreatmentOrdinal,
CASE WHEN P.PricingType = 'Treatment' THEN 'Treatment 0' ELSE P.PricingType END PricingType,
COALESCE(QuantityLooks, 0) AS QuantityLooks, --n
COALESCE(LooksPercentag
并且错误声明说:
Msg 102, Level 15, State 1, Line 350
Incorrect syntax near 'LooksPercentag'.
所以似乎动态sql正在被切断。
根据我以前的研究,我认为如果我做set @sql6=@sql6+'BUNCH OF CODE >8000'
我错过了什么吗?