Hi developers, I am writing this blog for helping one of my internet friend who asked for my help.
I am sharing the query on which the error is occurring for future reference.
Example:
declare @EmployeeTransID bigint
set @EmployeeTransID=33234000234454
declare @EmployeeTransIDGUID nvarchar(50)
select @EmployeeTransID as EmployeeTransID
set @EmployeeTransIDGUID = N'IMGHUNT' + @EmployeeTransID
select @EmployeeTransID as EmployeeTransID, @EmployeeTransIDGUID as EmployeeTransIDGUID
Error:
Error converting data type nvarchar to bigint.
Solutions:
You need to typecast the bigint to varchar.
set @EmployeeTransIDGUID = N'IMGHUNT' + CAST(@EmployeeTransID as varchar(50))
Hope you find the article helpful & interesting.
For any query, comment us below.
Keep learning and sharing...
No comments:
Post a Comment