I am getting this error when I am running this query.
I know this is not right but I did, and I just want to am justified answer about it.
Why this error is coming when we are running this below code.
DECLARE @tbl TABLE ( id INT, Name VARCHAR(5) );
INSERT INTO @tbl
SELECT 1 AS Id, 142 AS Alphabets
UNION
SELECT 2, 'XYZ'
UNION
SELECT 2, 'ABC'
SELECT * FROM @tbl
Getting error 'Conversion failed when converting the varchar value to data type int'
i am getting this error- What error?