Microsoft KB Archive/284141

= BUG: Insert From Subquery Returns Error Message 213 &quot;Insert Error..&quot; =

Article ID: 284141

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q284141



BUG #: 101144 (SQLBUG_70)



SYMPTOMS
The second INSERT in the script shown in the &quot;More Information&quot; section attempts to insert values into a table from a subquery. When you run the script, this error message occurs:

Server: Msg 213, Level 16, State 3, Line 2

Insert Error: Column name or number of supplied values does not match table definition.



WORKAROUND
To work around this problem, you can change the INSERT statement to either:   insert x (b,c) select b,c from y -or-   insert x (b,c) select b,c from (select b,c from y) z                       



STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0.



MORE INFORMATION
To reproduce this problem, run this script: use tempdb go create table x (b int, c int) create table y (b int, c int) go insert y (b,c) values (1,1) insert x (b,c) select * from (select b,c from y) z go drop table x drop table y go

Additional query words: TSQL Error Message 213

Keywords: kbbug kbpending KB284141

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.