$dbh->do("set nocount on"); # so it works on SQL Server 6.5 too my $sth = $dbh->prepare( "insert mumble SELECT @@IDENTITY ID"); $sth->execute; my $id = $sth->fetchrow_arrayref->[0]; $sth->finish; $dbh->do("set nocount off");