blackbirdMIT
IS-IT--Management
Table Properties - Odors
OdorID Int
OdorNum Int
Odor nvarchar(50)
Here's my Cursor:
DECLARE OdorCursor Cursor FOR
SELECT * FROM Odors;
DECLARE @TheCursor Cursor;
SET @TheCursor=OdorCursor;
OPEN @TheCursor;
DECLARE @OdorID Int;
DECLARE @OdorNum Int;
DECLARE @Odor nvarchar(50);
FETCH @TheCursor INTO @OdorID, @OdorNum, @Odor;
WHILE @@FETCH_STATUS=0
BEGIN
PRINT @OdorID + @Odor;
FETCH @TheCursor INTO @OdorID, @OdorNum, @Odor;
END
CLOSE @TheCursor;
DEALLOCATE @TheCursor;
--
Here's the syntax error I get:
Server: Msg 245, Level 16, State 1, Line 18
Syntax error converting the nvarchar value 'Warm' to a column of data type int.
How can I resolve the error above?
OdorID Int
OdorNum Int
Odor nvarchar(50)
Here's my Cursor:
DECLARE OdorCursor Cursor FOR
SELECT * FROM Odors;
DECLARE @TheCursor Cursor;
SET @TheCursor=OdorCursor;
OPEN @TheCursor;
DECLARE @OdorID Int;
DECLARE @OdorNum Int;
DECLARE @Odor nvarchar(50);
FETCH @TheCursor INTO @OdorID, @OdorNum, @Odor;
WHILE @@FETCH_STATUS=0
BEGIN
PRINT @OdorID + @Odor;
FETCH @TheCursor INTO @OdorID, @OdorNum, @Odor;
END
CLOSE @TheCursor;
DEALLOCATE @TheCursor;
--
Here's the syntax error I get:
Server: Msg 245, Level 16, State 1, Line 18
Syntax error converting the nvarchar value 'Warm' to a column of data type int.
How can I resolve the error above?