note
jfroebe
<p>Well, this is really more of a SQL Server / T-SQL question than a Perl question. From the example data you provided and the amount of time it takes, it appears that you either use referential integrity (primary/foreign keys) and/or triggers for a set of tables...</p>
<ol><li>Your file looks to be in a delimited format. Why not just use native bcp?</li>
<li>How long does it take for the inserts to run when using isql?</li>
<li>You're inserting one row at a time. One row per transaction. Is there a reason why you can't insert say 1,000 rows at a time before your execute()?</li>
<li>Instead of using single quotes for adding your data, use $dbh->quote($string) as there is no guarantee that your data file won't have embedded quotes that could mess up the insert. You may want to use <code>$query = sprintf "INSERT INTO SOWND1 values(%s)", $dbh->quote($data[$j]); $dbh->do($query);</code></li></ol>
<p>Don't be too quick to blame Perl here.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-304796">
<p>Jason L. Froebe</p>
<p><a href="http://jfroebe.livejournal.com">Blog</a>, <a href="http://www.froebe.net/blog">Tech Blog</a></p>
</div></div>
919662
919662