Error from 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 from command line

Postby ca8msm » Wed Oct 08, 2008 3:05 pm

Hi,

When I execute a package I have created via the command line, it throws an error. However, if I use the GUI to execute the package then it runs successfully.

The command I am using to execute the package is in the format:

MyPackage.exe /server:MyServer /database:MyDatabase /username:MyUserName /password:MyPassword

and the error message it generates is:

Data is null. This method or property cannot be called on Null values.

The event log shows this additional information:

Code: Select all
Event Type:    Error
Event Source:    DBVersion_1_0
Event Category:    None
Event ID:    0
Date:        08/10/2008
Time:        14:51:22
User:        N/A
Computer:    DS1000-2
Description:
Data is Null. This method or property cannot be called on Null values.

Server stack trace:
   at System.Data.SqlClient.SqlBuffer.get_String()
   at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
   at Package.DBVersion_1_0.EnvironmentFolders.GetMasterDatabaseFolder(SqlCommand sqlCommand)
   at Package.DBVersion_1_0.EnvironmentFolders.Init(SqlCommand sqlCommand)
   at Package.DBVersion_1_0.PackageExecutor.ConnectToDatabase()
   at Package.DBVersion_1_0.PackageExecutor.Execute()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
   at Package.DBVersion_1_0.ProgressDialog.Run(IProgressExecutor executor)
   at Package.DBVersion_1_0.PackageApplication.ExecutePackageWithUI()

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


Does anyone have any ideas on what the problem may be and/or how I can resolve this as ideally I need to execute this procedure via the command line?

Thanks,
Mark
ca8msm
 
Posts: 3
Joined: Wed Oct 08, 2008 2:53 pm

Postby Chris Auckland » Fri Oct 10, 2008 11:15 am

Thanks for your post.

I have been unable to reproduce this problem with any of my databases. Do you get the same problem if you generate the package again?

Would you be able to send me the problematic package so I can test it here?
If you can, please send it to support@red-gate.com.

If it is too large to send by email, can you send me an email and I will set you up an area on our ftp site.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby ca8msm » Fri Oct 10, 2008 11:22 am

Thanks Chris,

I've tried repackaging and still get the same error. I've sent an email to your support address so hopefully that will come through soon.

Thanks for looking into this,
Mark
ca8msm
 
Posts: 3
Joined: Wed Oct 08, 2008 2:53 pm

Postby ca8msm » Fri Oct 10, 2008 2:42 pm

Just to update the thread in case anyone else gets this issue, it looks as though it was a either a permissions error or a collation issue that was causing the problem.

I ran a presql script to change the collation of the database and ran the package under the "sa" account and the package installed successfully.
ca8msm
 
Posts: 3
Joined: Wed Oct 08, 2008 2:53 pm

Data is null. This method or property cannot be called on Nu

Postby thop » Fri Oct 10, 2008 7:24 pm

I had the same problem and found that the username that I was using did not having create database permissions.

Once I granted the Server Role of dbCreator it worked fine.
thop
 
Posts: 1
Joined: Fri Oct 10, 2008 7:17 pm
Location: Michigan, USA


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 0 guests