我所喜欢的
SqlServer中,用exec处理sql字符串中含有变量,提示:必须声明标量变量@
declare @tssj nvarchar(100) -- 外部变量 declare @Sql_Sql nvarchar(100) -- 存sql字符串变量 set @Sql_Sql =N'select @tssj=testid from dbo.Test' EXEC sp_executesql @Sql_Sql,N'@tssj int output',@tssj output select @tssj
Copyright @ 2024 飘扬De黑夜 Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster