in reply to Accessing SQL Server 2000

I normally use Win32::ODBC, not by choice, but it does the job.
use strict; use Win32::ODBC; my ($db); if (!ref($db = new Win32::ODBC("DSN=$dbname;UID=$username;PWD=$passwor +d"))) { my ($ErrNum, $ErrText, $ErrConn) = Win32::ODBC::Error(); #...IT FAILED - DO SOMETHING... } my $sql = "SELECT * FROM Table"; if($db->Sql($sql)){ #...FAILED... my ($ErrNum, $ErrText, $ErrConn) = $db->Error(); } while($db->FetchRow()){ my %data = $db->DataHash(); #...Processing Data... } $db->Close();

You could(my preference) use DBI::ODBC

As for padding with 0s, you could use my $padded_var = sprintf('%.2d',$var); replacing 2 with the total length of the value.