1SQL::Translator::ProducUesre:r:SCQoLnSterrivbeurt(e3d)PSeQrLl::DTorcaunmselnattaotri:o:nProducer::SQLServer(3)
2
3
4
6 SQL::Translator::Producer::SQLServer - MS SQLServer producer for
7 SQL::Translator
8
10 use SQL::Translator;
11
12 my $t = SQL::Translator->new( parser => '...', producer => 'SQLServer' );
13 $t->translate;
14
16 WARNINGB This is still fairly early code, basically a hacked version of
17 the Sybase Producer (thanks Sam, Paul and Ken for doing the real work
18 ;-)
19
21 field.list
22 List of values for an enum field.
23
25 * !! Write some tests !!
26 * Reserved words list needs updating to SQLServer.
27 * Triggers, Procedures and Views DO NOT WORK
28
30 TODO
31
32 # Text of view is already a 'create view' statement so no need to
33 # be fancy
34 foreach ( $schema->get_views ) {
35 my $name = $_->name();
36 $output .= "\n\n";
37 $output .= "--\n-- View: $name\n--\n\n" unless $no_comments;
38 my $text = $_->sql();
39 $text =~ s/\r//g;
40 $output .= "$text\nGO\n";
41 }
42
43 # Text of procedure already has the 'create procedure' stuff
44 # so there is no need to do anything fancy. However, we should
45 # think about doing fancy stuff with granting permissions and
46 # so on.
47 foreach ( $schema->get_procedures ) {
48 my $name = $_->name();
49 $output .= "\n\n";
50 $output .= "--\n-- Procedure: $name\n--\n\n" unless $no_comments;
51 my $text = $_->sql();
52 $text =~ s/\r//g;
53 $output .= "$text\nGO\n";
54 }
55
57 SQL::Translator.
58
60 Mark Addison <grommit@users.sourceforge.net> - Bulk of code from Sybase
61 producer, I just tweaked it for SQLServer. Thanks.
62
63
64
65perl v5.12.0 2009-0S8Q-L1:8:Translator::Producer::SQLServer(3)