sp_executesql得到执行sql语句的返回值
执行 sql语句,得到 变量的值
declare @RangeKey int='20160901' declare @Partition int; DECLARE @SQLString nvarchar(500); DECLARE @ParmDefinition nvarchar(500); SET @SQLString = N'SELECT @RangeKeyOUT = $PARTITION.[pf_Fact_XM_XMBJXX] (20160925)'; SET @ParmDefinition = N' @RangeKeyOUT int OUTPUT'; EXECUTE sp_executesql @SQLString, @ParmDefinition, @RangeKeyOUT=@Partition OUTPUT; select @Partition
本文来自博客园,作者:兴想事成,转载请注明原文链接:https://www.cnblogs.com/mjxxsc/p/5961172.html