Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error using SQL INSERT

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-01-10 : 08:33:39
Ben writes "Any idea why I am getting this error message??

[Microsoft][ODBC SQL Server Driver][SQL Server]There are fewer 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.
______________________

new_identity = rcs(0)
values = Split(Request.Form("hdnlist2"), ", ", -1, 1)
nunid = new_identity
For vnum = 0 To UBound(values)
SQL = "INSERT INTO NUN_ApplicationMatches (NUNId,AppID) VALUES (" & CStr(nunid) & ", " & CStr(values(vnum)) & ") "
Next
dbConn.Execute SQL"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-01-10 : 08:46:43
Display the sql statement before the exec and you will probably see the problem


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -