Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Multiple Insert

Author  Topic 

nhaas
Yak Posting Veteran

90 Posts

Posted - 2012-06-25 : 16:49:57
Is there a way to insert multiple new rows at 1 time? The only item that changes is the phone number?
phone numbers 10000 to 10099?

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2012-06-25 : 17:08:05
One way is to INSERT into your table from a SELECT statement. You can use any table or function that returns a bunch of numbers - tally table, numbers table, numbers function.
For instance this is a table in the master database of sql server:

--insert myTable (phoneNumber)
select number + 10000 as phoneNumber
from master..spt_values
where type = 'p'
and number < 100



Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -