var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Creating a loop
I need to create an SQL table and automatically populate it with 100,000 records (just one column).
How can I achieve this? The create table part is straight forward enough but how can I get all those rows in there using a single script?
I imagine the statement will require Loop and While.
This is for testing purposes.
declare @i int
insert into table_name values (@i)
I'm running this against a table I've already created and I'm getting..
"Server: Msg 213, Level 16, State 4, Line 5
Insert Error: Column name or number of supplied values does not match table definition."
can u paste the ddl for the table? how many columns does the table have?
replace the insert with:
insert into table_name (column_name) values (@i)
No worries - I got it to work in the end - I created a new table with just one column and everything is fine.
Thanks for your help amigo/amiga..
I'm hoping you can help with a problem leading on from this. The purpose of this exercise was to measure how long two scenarios take to create the tables and insert records.
Scenario A : Stand alone desktop
Scenario B : Server with dual processor Xeon
The database on each is identical - yet the Desktop took 01:07 to insert compared to the server's 06:48 !! Nearly 7 minutes!
Any ideas what could be causing this??