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)
 update query

Author  Topic 

vicki
Posting Yak Master

117 Posts

Posted - 2002-04-10 : 09:51:54
Hi,
I got the error message although I double chech my column again and again but I don't see any incorrect name but why I got this errror:
===============================
Server: Msg 213, Level 16, State 4, Line 1
Insert Error: Column name or number of supplied values does not match table
definition.
Server: Msg 207, Level 16, State 1, Line 5
Invalid column name 'cases'.
Server: Msg 207, Level 16, State 1, Line 5
Invalid column name 'allowed'.
=====================

Here is the query:
================
Insert into dibind
select doc, Non_Defferred_Cases as cases,
Non_Def_Cases_Allowed as allowed
from nondeferred
Update dibind
Set Non_Defferred_Cases = cases,
Non_Def_Cases_Allowed = allowed
from dibind A, nondeferred B
where A.doc = B.doc
------------------------
Thanks alot

jongregg
Starting Member

31 Posts

Posted - 2002-04-10 : 09:55:31
I think you may find that the columns in nondeffered are labelled differently to 'cases' and 'allowed'. If you post your table structures, all should be revealed.


Go to Top of Page

jongregg
Starting Member

31 Posts

Posted - 2002-04-10 : 10:10:29
Also, after re-reading, you may have more columns in dibind than you are inserting i.e. you are trying to insert three columns into a four column table. When you do this, you need to specify which coulmns are being inserted into e.g.

INSERT INTO DIBIND
(
COL1,
COL2,
COL3
)
SELECT
doc,
non_defferred_cases,
Non_Def_Cases_Allowed
FROM
nondeferred

Still need to post your table structure to make doubly sure.

Jon




Go to Top of Page

dsdeming

479 Posts

Posted - 2002-04-10 : 10:13:41
The first thing to check if whether or not the dibind table contains only doc, cases, and allowed in that order.

Go to Top of Page
   

- Advertisement -