Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERT SQL VALUES VARYING
Message
De
24/10/2001 16:44:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00572866
Message ID:
00572900
Vues:
28
This message has been marked as the solution to the initial question of the thread.
>Hi folks - just wondered if anyone knew of an equivalent MS SQL command to this RDB SQL command...
>
>INSERT INTO table (field1, field2, field3) VALUES (fixed, fixed, var1) VARYING (var1 [1-52])
>
>This makes one statement do 52 inserts...
>
>Any ideas?

Not exactly, but you can do a multiple row insert by specifying a select statement instead of the VALUES(). Combining this with an existing table, an identity column and the TOP clause you can get close to the same effect:
Insert Into table 
   Select Top 52 'something1' as fixed, 'something2' as fixed2 
   From myExistingTable
The existing table would need to have the number of rows specified after the TOP clause, and the target table would need to have the identity field defined (var1 in your example). Unfortunately you would not control the sequence on the identity field by going this way unless you clear the table of rows first with TRUNCATE TABLE.

Just a wild idea.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform