[Solved] how to insert many transactions of similar detail in sql server [closed]


If your names are stored in another table then you can do the following:

insert into test (id, name, address, phonenumber)
select id, name, '123 test dr', '12345678'
from names

select * from test

See SQL Fiddle with Demo

Based on your edit, you will do the following:

declare @recNum int = 0

while @recNum < 100
  BEGIN
    INSERT INTO people (po_box, name, address)
    SELECT 100501 + @recNum, 'MICHAEL COLLINS', 'MBEAL NA BLATH'

    set @recNum = @recNum + 1
  END


select *
from people

See SQL fiddle with Demo

1

solved how to insert many transactions of similar detail in sql server [closed]