-2
I need to enter a value in the table, but there is a field with the name 'Status', which is a reserved SQL word. How do I use this field in INSERT?
insert into <<tabela>> (status) values ('A')
The error returned is:
There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
which the
SGBD
what are you using? And what seems most wrong to me is using<>
as a table name.– Sorack
I’m not using <> as a table name, actually I put <<table>, but stackoverflow overwritten. I’m using SQL Server 2016
– Ester Ribeiro
What mistake are you making? The
SQL Server
allows this column normally.– Sorack
I need to insert a large amount of values into a table, but am getting column amount error in table. There are more Columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of Columns specified in the INSERT statement. Only I’m looking for which field I put the most and I need to know if it’s the Status field, because it turns blue as a reserved word.
– Ester Ribeiro
Your error is not that then. The translation of your error is " There are more columns in the INSERT statement than the values specified in the VALUES clause. The number of values in the VALUES clause should correspond to the number of columns specified in the INSERT statement.". Probably your
INSERT
is not the one you reported in the question.– Sorack
In Postgresql you should use double quotes (delimited Identifier or quoted Identifier): "status".
– anonimo
I need to know if I have to use something like double quotes in SQL Server in reserved words when I put as field name.
– Ester Ribeiro
Read my comment. Your error has nothing to do with the column
status
.– Sorack
I know the problem is the amount of values, but the word status in the bank is as reserved, should not be of the ANSI standard. I want to know if you have something like quotes to use in reserved words in case you name fields, to see if this can be the problem (do not identify the word status as field, so do not identify the value I am entering in this field).
– Ester Ribeiro