DBIx::TableReferences::MSSQL

Perl extension for getting information about declared referential constraints in MS SQL Server 2000 databases.
Download

DBIx::TableReferences::MSSQL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Edward Guiness
  • Publisher web site:
  • http://search.cpan.org/~edwardg/

DBIx::TableReferences::MSSQL Tags


DBIx::TableReferences::MSSQL Description

Perl extension for getting information about declared referential constraints in MS SQL Server 2000 databases. DBIx::TableReferences::MSSQL is a Perl extension for getting information about declared referential constraints in MS SQL Server 2000 databases.SYNOPSIS use DBIx::TableReferences::MSSQL; $tr = DBIx::TableReferences::MSSQL->new( $dbh ); my $table = 'sales'; @reftables = $tr->reftables($table); print "'$table' references these tables: @reftables ";Output (assuming $dbh is connected to the pubs database) 'sales' references these tables: dbo.stores dbo.titlesWant more information? $refdetails = $tr->references('sales'); for $ref (@{$refdetails}) { # The owner.name of the referenced table print "$ref->{refowner}.$ref->{reftable} "; # columns in the referential constraint @fkeys = @{$ref->{cols}}; # FK @rkeys = @{$ref->{refcols}}; # PK while ($fkey = shift @fkeys, $rkey = shift @rkeys) { print " $fkey -> $rkey " } }Output (showing the columns involved in the referential constraints) dbo.stores stor_id -> stor_id dbo.titles title_id -> title_id Requirements: · Perl


DBIx::TableReferences::MSSQL Related Software