I am writing a stored procedure and have declared a table as part of the code. I get an error
There are fewer columns in the INSERT statement than values specified in the VALUES clause
Here's my code:
DECLARE @FullTaskList TABLE (fval INT)
INSERT INTO @FullTaskList(fval)
VALUES ( (1), (2), (3), (4), (5) )
I would be very grateful if you can help me.
You just have too many parentheses:
DECLARE @FullTaskList TABLE ( fval INT )
INSERT INTO @FullTaskList ( fval )
VALUES (1), (2), (3), (4), (5);
Your syntax is interpreted as (1, 2, 3, 4, 5)
, which is five values in one row, rather than five rows with one value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With