sql server - Insert error in sql cursor -


i have sql server query cursor:

declare @ids table(id varchar(50))  insert @ids values ('1098264', '1098859', '1098860', '1098267', '1098265') 

but when run code, error:

insert error: column name or number of supplied values not match table definition.

you have 1 column in table i.e id , trying insert 5 column values in table.

try this

create table :

declare @ids table(id varchar(50)) 

insert values table :

insert @ids values ('1098264') insert @ids values ('1098859') insert @ids values ('1098860') insert @ids values ('1098267') insert @ids values ('1098265') 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -