use DBI; #database parameters my ( $data_source, $database, $user_id, $password ) =qw ( servername domain username password ); my $conn_string = "driver={SQL Server}; Server=$data_source; Database=$database; UID=$user_id; PWD=$password"; #Connect the database handle. my $dbh = DBI->connect("DBI:ODBC:$conn_string") or die "$DBI::errstr\n"; $insertSQL = <<'EndOfSQL'; INSERT INTO delivery (customerNo,salesOrderNo,sequenceNo,incrementNo,requestDate,quantity,deliveryDate,externalNotes,shipVia) VALUES(?,?,?,?,?,?,?,?,?) EndOfSQL my $insertHandle = $dbh->prepare($insertSQL) or die "Problem creating inserting handle: ", $dbh->errstr; ########### show error ########## print "$dbh->errstr"; $insertHandle->execute('customerNo', 'salesOrderNo', 'sequenceNo', 'none', 'dateD', 'quantityD', 'dateD', 'none', 'companyD') or die "Problem Inserting: ", $dbh->errstr; #EndofSQL # Execute the query $SQL->execute() || die "Couldn't execute statement: $DBI::errstr\n"; $rowCount = $SQL->commit(); $dbh->disconnect();