我正在将SQL Server 2000数据库移动到SQL Server 2008 R2平台。
但是,在SQL Server 2008中似乎没有运行1个存储过程的意义上存在问题。
这是存储过程
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[prAccntDetails]
@budgetId nvarchar(4) = NULL,
@taskId nvarchar(10) = NULL,
@grantId nvarchar(13) = NULL,
@locId nvarchar(13) = NULL,
@accntId nvarchar(15)
AS
IF @budgetId IS NULL SET @budgetId = '%'
IF @taskId IS NULL SET @taskId = '%'
IF @grantId IS NULL SET @grantId = '%'
IF @locId IS NULL SET @locId = '%'
SELECT d.accntId, d.actualAmt, d.commAmt,d.date, d.jnlType,
d.jnlSource, o.emailAddress, d.transReff, d.descriptn
FROM tblOperators o INNER JOIN
tblAllDetails d ON
o.operatorId = d.jnlSource
WHERE d.budgetId LIKE @budgetId
AND RTRIM(d.taskId) LIKE @taskId
AND RTRIM(d.grantId) LIKE @grantId
AND RTRIM(d.locId) LIKE @locId
AND RTRIM(d.accntId) LIKE @accntId
ORDER BY d.date
在SQL Server 2000中,当我提供必要的参数时,该过程运行正常但在SQL Server 2008中它什么都不返回。所有帮助将不胜感激