> Obviously, I need a counter and execute the statement several times if theNot really, try this:> quantity to insert is greater than 1000.
CREATE TABLE Table1000 (Number INT IDENTITY)
WHILE COALESCE(SCOPE_IDENTITY(),0) < 1000
INSERT INTO Table1000 DEFAULT VALUES
DECLARE rows INT
SET rows = 5000
SET ROWCOUNT rows
SELECT Value= (Table1000_1000.Number - 1) * 1000 + Table1000_1.Number +100
FROM Table1000 Table1000_1 CROSS JOIN Table1000 Table1000_1000
SELECT * FROM #myTable
DROP TABLE #myTable
DROP TABLE Table1000
Jacco Schalkwijk MCDBA, MCSD, MCSE
"Alberto Richart" <a.richartpreference.es> wrote in message
> I usually face the problem of inserting a great deal of data in onedatabase> For instance, I would like to add 100 rows in a table which contains just
> one int column (from 101 to 200).
> I would like to know if it's possible to solve the problem using just one
> insert statement and without the help of any helper table.
> To workaround this problem, I have a helper table (Table1000) in my1> structure which contains just one column (Number int) and 1000 rows, from> to 1000. The solution in this case is simple:
> select top 100 Value=Table1000.Number+100
> into #myTable
> FROM Table1000
> ORDER BY Number
> select *
> from #myTable
> drop table #myTable
> Obviously, I need a counter and execute the statement several times if the
> quantity to insert is greater than 1000.
> Thanks in advance,