Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Insert Statement!!!
Message
 
 
À
09/12/2004 21:35:01
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00968203
Message ID:
00968204
Vues:
10
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform