BUG: Stored Procedure May Fail with Error 264ID: Q163375
|
When you run a stored procedure with two parameters that performs an
update, you may receive the following error message if the datatype of the
first field in the target table is defined as smallint:
Msg 264, Level 16, State 1
Column name appears more than once in the result column list.
CREATE TABLE NextIDs
(
SmallIntID smallint,
NextID int
)
GO
INSERT NextIDs values (0, 0)
GO
DROP PROCEDURE sp_GetNextID
GO
CREATE PROCEDURE sp_GetNextID
(@IDName varchar(15),
@NextID int OUTPUT)
AS
UPDATE NextIDs SET NextID = NextID + 1, @NextID = NextID
GO
DECLARE @NextID int
EXEC sp_GetNextID 'TEST', @NextID OUTPUT
SELECT @NextID
To work around this problem, do any of the following:
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Keywords : kbusage SSrvStProc kbbug6.50 kbbug6.00
Version : 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: April 8, 1999