use DBI; my $dsn = 'driver={SQL Server}; Server=SERVERNAMEHERE; database=DBNAMEHERE; uid=UIDHERE; pwd=PWHERE'; my $dbh = DBI->connect("dbi:OOOO:$dsn",{AutoCommit => 1}) or die "$DBI::errstr\n"; my $sql = "select field1, field2 from location where restriction = 'RESTRICTION NAME'"; my $sth = $dbh->prepare( $sql ); $sth->execute(); $sth->finish(); $dbh->disconnect();