1 package SQL::Translator::Producer::SQLServer;
7 $DEBUG = 1 unless defined $DEBUG;
9 use SQL::Translator::Schema::Constants;
10 use SQL::Translator::Utils qw(debug header_comment);
11 use SQL::Translator::Generator::DDL::SQLServer;
14 my $translator = shift;
15 SQL::Translator::Generator::DDL::SQLServer->new(
16 add_comments => !$translator->no_comments,
17 add_drop_table => $translator->add_drop_table,
18 )->schema($translator->schema)
25 SQL::Translator::Producer::SQLServer - MS SQLServer producer for SQL::Translator
31 my $t = SQL::Translator->new( parser => '...', producer => 'SQLServer' );
36 This is currently a thin wrapper around the nextgen
37 L<SQL::Translator::Generator::DDL::SQLServer> DDL maker.
39 =head1 Extra Attributes
45 List of values for an enum field.
51 * !! Write some tests !!
52 * Reserved words list needs updating to SQLServer.
53 * Triggers, Procedures and Views DO NOT WORK
56 # Text of view is already a 'create view' statement so no need to
58 foreach ( $schema->get_views ) {
59 my $name = $_->name();
61 $output .= "--\n-- View: $name\n--\n\n" unless $no_comments;
64 $output .= "$text\nGO\n";
67 # Text of procedure already has the 'create procedure' stuff
68 # so there is no need to do anything fancy. However, we should
69 # think about doing fancy stuff with granting permissions and
71 foreach ( $schema->get_procedures ) {
72 my $name = $_->name();
74 $output .= "--\n-- Procedure: $name\n--\n\n" unless $no_comments;
77 $output .= "$text\nGO\n";
86 See the included AUTHORS file:
87 L<http://search.cpan.org/dist/SQL-Translator/AUTHORS>
91 Copyright (c) 2012 the SQL::Translator L</AUTHORS> as listed above.
95 This code is free software and may be distributed under the same terms as Perl