Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INSERT SQL VALUES VARYING
Message
From
24/10/2001 16:44:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00572866
Message ID:
00572900
Views:
27
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform