Error using command line

Packages and compresses schema and contents of SQL Server databases

Moderators: JonathanWatts, Chris Auckland, David Atkinson, david connell, Anu Deshpande, Michelle Taylor, james.billings, Marianne

Error using command line

Postby Garymazzone » Wed Oct 28, 2009 7:24 pm

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?
Garymazzone
 
Posts: 6
Joined: Tue Oct 06, 2009 6:18 pm

Postby Chris Auckland » Fri Oct 30, 2009 4:44 pm

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
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby Chris Auckland » Tue Nov 03, 2009 6:26 pm

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
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Another potential cause of this issue

Postby mist83 » Thu Jan 12, 2012 1:16 am

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.
mist83
 
Posts: 1
Joined: Thu Jan 12, 2012 12:58 am

Postby fuyunb » Sat Jun 30, 2012 4:58 am

fuyunb
fuyunb
 
Posts: 1
Joined: Sat Jun 30, 2012 4:55 am


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 0 guests

cron