use DBI; use DBD::ODBC; my ( $data_source, $database, $user_id, $password ) = qw( server datab +ase user password ); my $conn_string = "driver={SQL Server};Server=$data_source;Database=$d +atabase;UID=$user_id;PWD=$password"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr; my $sql = "SELECT * FROM tbl_Foo (NOLOCK)"; my $sth = $dbh->prepare( $sql ); $sth->execute; while ( my $result = $sth->fetchrow_hashref ) { # Your fields can be accessed through the $result hashref, for exa +mple: print $result->{First_Name}; } $dbh->disconnect;