Error using command line

GarymazzoneGarymazzone Posts: 16 Bronze 1
I'm trying to create an exe from the command line based on a script and and getting an error

SQL Packager Command Line V6.0.1.9
==============================================================================
Copyright c Red Gate Software Ltd 1999-2008

Serial Number:511-005-109595-E5C9

Creating package...
Unexpected error: unexpected char: 0xFFFF
unexpected char: 0xFFFF
antlr.TokenStreamRecognitionException
at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.WaitForBackgroundThread()
at f.a(PackagerEngine )
at g.a()
at g.a(a& )
at RedGate.SQLPackager.Engine.PackagerEngine.a(ProgressPercentageTracker , d
)
at RedGate.SQLPackager.Engine.PackagerEngine.Package()
at RedGate.SQLPackager.CommandLine.Runner.e()
at RedGate.SQLPackager.CommandLine.Runner.Run()
at RedGate.SQLPackager.CommandLine.Startup.a(String[] )


The command line is:
C:\Program Files\Red Gate\SQL Packager 6>sqlpackager /makeexefromscript /ss:C:\t
emp\ProcessJobsandDataabasesV21.sql /name:c:\temp\WarehouseChanges.exe /rundb:master

any idea what is wrong with this?

Comments

  • Thanks for your post.

    I don't see any problem with your command, so I suspect the problem will be related to the script you are packaging.

    I take it the script parses alright, so there must be something else in the script that SQL Packager doesn't like.

    Does the script contain any particulary large blocks of SQL, say over 250 lines?

    If you would like me to take a look at the script, feel free to send it to me. I'll also send you an email with your support ticket refrence.
    Chris
  • Sorry for the delay in this response.

    It turns out that I made a bit of a mistake when I said there was nothing wrong with your command.

    The /name switch doesn't support the full 'path' + 'filename', so you will also need to use the location switch. e.g.

    C:\Program Files\Red Gate\SQL Packager 6>sqlpackager /makeexefromscript /ss:C:\temp\ProcessJobsandDataabasesV21.sql /name:WarehouseChanges.exe /location:c:\temp /rundb:master

    I hope this helps.
    Chris
  • I'm using 6.3.1.31 and thought I would share my experience and fix for the problem. This may be fixed already, but in case someone is running into the same issue here is my story:

    I have a huge sql file that I'm trying to package that looks something like this...

    UPDATE Table1 SET A=1 WHERE B=2
    GO
    UPDATE Table2 SET C=1 WHERE D=2
    GO
    UPDATE Table3 SET E=1 WHERE F=2
    GO

    However, the version I'm using (6.3.1.31) seems to partition the single script based on lines whose text == "GO", regardless of the context. Thus this file:

    UPDATE Table1 SET A=1 WHERE B=2
    GO
    /*
    UPDATE Table2 SET C=1 WHERE D=2
    GO :twisted:
    */
    UPDATE Table3 SET E=1 WHERE F=2
    GO

    will error because it will try to partition the main file into 3 SQL script resources:

    Script 1)
    UPDATE Table1 SET A=1 WHERE B=2
    Script 2)
    UPDATE Table2 SET C=1 WHERE D=2
    Script 3)
    */
    UPDATE Table3 SET E=1 WHERE F=2

    ...The third script is what is causing the error, because the program doesn't recognize that the "GO" statement on line 5 should be ignored because it's inside a comment block.
    My file should only have been partitioned into 2 scripts, not 3.
Sign In or Register to comment.