X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FDBI%2FSQLServer.pm;h=2bf999a91c5f791f7caf2c1e3ca90d361e837d48;hb=478f608d9028508396da37bb5df10b3057b96981;hp=47bd5ff8f15159312912423116beb746c8fc4f17;hpb=4e0de84cc3ca34b874decd22ff70aff8ba3b7b53;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Parser/DBI/SQLServer.pm b/lib/SQL/Translator/Parser/DBI/SQLServer.pm index 47bd5ff..2bf999a 100644 --- a/lib/SQL/Translator/Parser/DBI/SQLServer.pm +++ b/lib/SQL/Translator/Parser/DBI/SQLServer.pm @@ -1,9 +1,9 @@ package SQL::Translator::Parser::DBI::SQLServer; # ------------------------------------------------------------------- -# $Id: SQLServer.pm,v 1.3 2006-05-04 20:45:58 duality72 Exp $ +# $Id$ # ------------------------------------------------------------------- -# 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 @@ -39,8 +39,7 @@ use DBI; use SQL::Translator::Schema; use Data::Dumper; -use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; +use vars qw[ $DEBUG @EXPORT_OK ]; $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; @@ -141,7 +140,7 @@ SELECT o.name, colid,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id - WHERE o.type ='P' + WHERE o.type in ('P', 'FN', 'TF', 'IF') } ); @@ -297,6 +296,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 +322,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},