Error: Object reference not set to an instance of an object.
JackLocke
Posts: 25
Hi All,
I am currently evaluating SQL Packager for my company. And one of the feature we are interested in is to have ability to call SQL Packager via CLI and integrate it in our installer.
Currently I am trying to generate exe for update database by comparing two versions of database. I am using following command,
"C:\Program Files (x86)\Red Gate\SQL Packager 6\SQLPackag
er.exe" /database1:NEW /database2:OLD /location:"C:\Users\Administrator\Desktop
\test" /name:TestPKG /makeexe
And following is output of that command, (excluding database object details)
SQL Packager Command Line V6.4.0.8
==============================================================================
Copyright c Red Gate Software Ltd 1999-2008
TRIAL STATUS: You have 13 days left in your trial.
Serial Number:
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Summary Information
==============================================================================
DB1 = (local).NEW
DB2 = (local).OLD
Object type Name DB1 DB2
<includes db objects>
.......
.......
.......
.......
.......
.......
.......
.......
.......
Registering databases
Mapping
Comparing databases
Error: Object reference not set to an instance of an object.
I dont understand why I am getting object reference error here. It is local instance and user is administrator of that instance.
Thanks,
Jack
I am currently evaluating SQL Packager for my company. And one of the feature we are interested in is to have ability to call SQL Packager via CLI and integrate it in our installer.
Currently I am trying to generate exe for update database by comparing two versions of database. I am using following command,
"C:\Program Files (x86)\Red Gate\SQL Packager 6\SQLPackag
er.exe" /database1:NEW /database2:OLD /location:"C:\Users\Administrator\Desktop
\test" /name:TestPKG /makeexe
And following is output of that command, (excluding database object details)
SQL Packager Command Line V6.4.0.8
==============================================================================
Copyright c Red Gate Software Ltd 1999-2008
TRIAL STATUS: You have 13 days left in your trial.
Serial Number:
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Summary Information
==============================================================================
DB1 = (local).NEW
DB2 = (local).OLD
Object type Name DB1 DB2
<includes db objects>
.......
.......
.......
.......
.......
.......
.......
.......
.......
Registering databases
Mapping
Comparing databases
Error: Object reference not set to an instance of an object.
I dont understand why I am getting object reference error here. It is local instance and user is administrator of that instance.
Thanks,
Jack
Comments
Would it be possible for you to try running a comparison in SQL Compare with the same two databases. I would like to know whether you encounter the same error message or if the comparison goes through. If you are able to recreate the same error message, please can you follow these steps.
- enable error logging, as described in this document:
http://www.red-gate.com/SupportCenter/C ... _log_files
- recreate the error message one more time.
- disable error logging, as described in the above document (the file can grow very quickly so please try not to leave this running too long).
- locate the log file and send to support@red-gate.com quoting the support ticket number F0061318.
If you have any problems, then please let me know (either by email or posting back here).
Hi,
I can generate exe,C# app or .sql script if I use GUI for same databases and log doesn't show any error. But if I try to do this via CLI, and enable logging for execution by including /verbose switch in command. So my new command looks like this,
This will display whole sql script generated by packager based on comparison. But this doesn't show me anything extra for error. I understand that this error is very generic and it is difficult to pin point actual issue. But as you can see my original post this error comes right after
And I think it might give you a clue about what could be wrong here.
Thanks,
Jack
It is indeed very frustrating issue. And strangest most thing is if I do exactly same thing in UI, it works just fine ! But I don't want to use UI, we want to automate this thing using CLI.
And say if it solves my issue by excluding new updates then what's point of even using this sofware because that's the whole point of having this product, no ?
By looking at their current response, I wonder how is RedGate's after sales support ...
Thanks anyway. I am glad to see that I am not the only one with similar issue.
Jack
Previously, I was able to encounter similar or the same errors using the UI components (SQL Compare and SQL Data Compare), but no longer. I'm hoping it's just related to using older comparison libraries and that we'll see a new SQL Packager using new comparison libraries, or automation of the individual actual products.
But, like I said overall RedGate has been really good to me and I couldn't do a lot of things without them or their tools; in case that helps ease your concern at all.
C:\Program Files (x86)\Red Gate\SQL Packager 6>sqlpackager.exe /db1:WAP-Official /n:WAPOfficialPackage /exe /options:d,idn,k
Registering databases
Mapping
Error: Object reference not set to an instance of an object.
Is anyone at Red-Gate working on this problem?