my $sth = $dbh->prepare("SELECT constraint_name FROM information_schema.constraint_column_usage WHERE TABLE_NAME = '$tbl'"); $sth->execute; my $temp = $sth->fetchrow_arrayref; foreach my $rel (@$temp) { next unless ($rel =~ /ID/); print "Relationship: $rel\n"; my $th = $dbh->prepare("ALTER TABLE Data_CentersTEST DROP CONSTRAINT $rel"); $th->execute; } #### DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt (SQL-HY000) at U:\Doccuments\Scripts\Test\sql_do3.pl line 78.