SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Multiple Insert
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nhaas
Yak Posting Veteran

USA
90 Posts

Posted - 06/25/2012 :  16:49:57  Show Profile  Visit nhaas's Homepage  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
5469 Posts

Posted - 06/25/2012 :  17:08:05  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000