Downgrade global version - highest version in 9002 on cpan is 1.58 - thus go with...
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / DBI / SQLServer.pm
index 129ae36..267e6f8 100644 (file)
@@ -1,9 +1,7 @@
 package SQL::Translator::Parser::DBI::SQLServer;
 
 # -------------------------------------------------------------------
-# $Id: SQLServer.pm,v 1.4 2006-08-26 11:37:18 schiffbruechige Exp $
-# -------------------------------------------------------------------
-# Copyright (C) 2002-4 SQLFairy Authors
+# Copyright (C) 2002-2009 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -40,7 +38,7 @@ use SQL::Translator::Schema;
 use Data::Dumper;
 
 use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/;
+$VERSION = '1.59';
 $DEBUG   = 0 unless defined $DEBUG;
 
 no strict 'refs';
@@ -113,7 +111,7 @@ ORDER BY o.name,
             if defined;
     } @{$dbh->selectall_arrayref("SELECT DISTINCT object_name(id)
                                     FROM sysindexes
-                                   WHERE indid > 0 and indid < 255 and rows > 0 and
+                                   WHERE indid > 0 and indid < 255 and
                                          name not like '_WA_Sys%'")};
 
     ## slurp objects
@@ -297,6 +295,7 @@ $_->{INDEX_NAME},
         } elsif ($table_info->{TABLE_TYPE} eq 'VIEW') {
                next if $table_info->{TABLE_NAME} eq 'sysconstraints'
                        || $table_info->{TABLE_NAME} eq 'syssegments';
+               next if !$stuff->{view}->{$table_info->{TABLE_NAME}}->{text};
             my $view =  $schema->add_view(
                                           name =>
 $table_info->{TABLE_NAME},
@@ -322,6 +321,7 @@ $table_info->{TABLE_NAME},
     }
 
     foreach my $p (values %{$stuff->{procedures}}) {
+       next if !$p->{text};
         my $proc = $schema->add_procedure(
                                name      => $p->{name},
                                owner     => $p->{PROCEDURE_OWNER},