Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Insert Statement!!!
Message
 
 
To
09/12/2004 21:35:01
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00968203
Message ID:
00968204
Views:
11
This message has been marked as the solution to the initial question of the thread.
No, this error occurs if number of values returned by SELECT doesn't match to the number of fields in the table (is less or more). You can specify list of fields in such case
Insert into Test (Title_ID, Title)
Select
   title_id,
   title
   from titles
>
>I need to know why this code generates an error? It is my understanding that I can create a table "Test" with 3 fields...
>Create Table Test(
>   Title_ID VarChar(6) Null,
>   Title VarChar(80) Null,
>   Type Char(12) Null)
>
>.. and populate it using a select statment filling only 2 fields...
>
>Insert into Test
>Select
>   title_id,
>   title
>   from titles
>... but this script keep generating an error:
>"Insert Error: Column name or number of supplied values does not match table definition."
>
>I know that this error occurs if i supply more fields in the INSERT statement than what is available in the TABLE. Right?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform