select list for the INSERT statement contains fewer items than the insert list
Posted on 2003-11-08
I am trying to run an insert statement as part of a larger script. The statement is:
insert into gld2kclsql.omegadirect.dbo.tbl_sc_prices
from gld2kclsql.omegadirect.dbo.tbl_sc_header) m_id
, gld2kclsql.wpfileimp.dbo.data_transform1 dt
dt.contractnum = m_id.contract
and dt.sub_load_id = @LOADID --** change to current load_id from
and dt.do_not_mail = 0
The error that keeps coming up is:
Server: Msg 120, Level 15, State 1, Line 439
The select list for the INSERT statement contains fewer items than the
insert list. The number of SELECT values must match the number of INSERT
Server: Msg 8180, Level 16, State 1, Line 439
Statement(s) could not be prepared.
This statement was working fine yesterday. Last night the database had to be backed up and restored to a new server which was also named gld2kclsql. The @id2 is set above in the script and there are no intervening "go" statements that would null it out. Why can't the 9 insert items all be seen? Any ideas from anyone??