Error from command line

ca8msmca8msm Posts: 4
edited October 10, 2008 2:24PM in SQL Packager Previous Versions
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:
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

Comments

  • 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
  • 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
  • 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.
  • 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.
Sign In or Register to comment.