in reply to Re: How many record insert into SqlServer 2K per second?
in thread How many record insert into SqlServer 2K per second?
* Your hardware configuration and environment.
My client host :192.168.11.12 ,and the SqlServer DB server:192.168.11.16 .They located at some place.
* Your disk system(s).
My client host HD:300G.
* Your database engine's configuration.
DB is charged by our DBA.I really don't know what's config you means
* The structure of your database instance (definition of tables, indices, and objects).
Table Definition:
test_c (ID int not null,cust_id int not null,status char(1) null,money decimal(12,2) null)
no indices
* The nature of the data you are inserting.
My data is from my client host's sqlite DB
* The client script you use to access your database.
My Code :I have tried the placeholder method,but the sqlserver 2K doesn't support it.#!/usr/bin/perl use strict; use warnings; use DBI; my $mydbh = DBI->connect( "dbi:SQLite:/root/loc.db","","",{AutoCo +mmit => 0} ) or die "Error $DBI::errstr \n"; my $dbh = DBI->connect( "dbi:Sybase:server=192.168.11.16;databa +se=customer", "xxx", "xxx", {AutoCommit =>1}) or die $DBI::errstr; insert_it(); $mydbh->disconnect; $dbh->disconnect; exit; ########################## sub insert_it() { my $r = get_data(); for (keys %$f) { my $mo = $r->{$_}->{money}; my $status= $r->{$_}->{status}; $dbh->do(qq{insert into test_c(custid,money,status) values + ($_,'$mo','$status')}) or die $DBI::errstr; } } sub get_data { my %data; my $sth = $mydbh->prepare(qq{select custid,money,status from tem +p_test order by custid}); my ($cid,$mon,$sta); $sth->execute() or die $DBI::errstr; $sth->bind_columns(undef, \$cid, \$mon, \$sta); while ( $sth->fetch() ) { $data{$cid} = {money => $bal, status => $sta}; } return \%data; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How many record insert into SqlServer 2K per second?
by andreas1234567 (Vicar) on Aug 30, 2007 at 08:17 UTC |