DECLARE @Sql NVARCHAR(MAX),@ReceiveID NVARCHAR(50)
SET @ReceiveID = ' WHERE AreaID = 11'
SET @Sql = 'SELECT * FROM dbo.Area_Info'
IF (ISNULL(@ReceiveID, '') <> '')
BEGIN
SET @Sql = @Sql +@ReceiveID
END
--PRINT @Sql
EXEC (@Sql)
详细解决方案
T-SQL话语的拼接后,查询结果集
热度:131 发布时间:2016-05-05 15:25:10.0
相关解决方案