Skip to content
Advertisement

Stored Procedure Data Type Conversion Error

I try to execute the following SP it gives me this following error.

Msg 8114, Level 16, State 5, Procedure TEST, Line 55 [Batch Start Line 12] Error converting data type nvarchar to bigint.

I tries casting the value when passing insert into values but still gave the same error.

Tables contain doc_id BIGINT & line_id INT

Still it prints

Msg 8114, Level 16, State 5, Procedure TEST, Line 55 [Batch Start Line 12] Error converting data type nvarchar to bigint.

Following is the procedure I created.

Advertisement

Answer

The variable order in FETCH is incorrect. [doc_id] is being saved in @companycode declared as VARCHAR(100). You should check the other variable order as there are not correctly specified.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement