SQL Login and Packager

dm4714dm4714 Posts: 28
edited July 13, 2005 12:32PM in SQL Packager Previous Versions
OK -- perhaps I do not understand Packager and seem to be having a problem.

I have a setup program that installs and launched Packager and the end of setup.

During setup, I execute an sp_addlogin SP to create a SQL login.

Later, Packager runs, creates the database and creates the database user.

The problem I'm having is that I cannot log into SQL Server using the new login. If I delete database and login and simply recreate login manually, it works.

I've verified the password that I'm using and it is correct. In fact, I've copied/pasted the .SQL file into QueryAnalzer to run to be certain.

I see no problems with how I'm creating the login, however Packager is messing it up somehow.

My default database for the login is "master".

Does anyone have any ideas how to resolve this?

Comments

  • Hello --

    I just figured out that Packager creates a SQL Login and assigns permissions to a particular database to a user. Apparently, Packager was running before my SQL script was run to create the login myself.

    Packager appears to set a password for the new login to P@ssw0rd. Where is this mentioned in the document? I could not find it.

    How do I change the default password?

    Is there a way I can set this password when the package is created?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    I meant to reply to this yesterday but something happened on the server yesterday and apparently my reply wasn't accepted, so my apologies for that.

    Anyway... It's true. You have two choices, either use your own script to create the user with the proper password and tell the packager not to script the user when you create the package, or let SQL Packager create the user. SQL Packager creates all new users with a password of p@ssw0rd. There is no setting for changing this. You could possibly script a password change after Packager runs, though, using sp_password.
  • Thanks -- I got it working now.

    It would be nice if I could edit the package script. This would allow me to change the password.

    I assume this is hardcoded somewhere within the Packager.exe and I cannot change the default?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    The password is hardcoded in the Packager code.

    You could save the package as a C# project rather than an executable, the edit the resources (the SQL scripts are saved as .NET resources), but it 's fairly messy and would prevent you from using the compression.

    Once you make the changes to the C# project, you could compile it in Visual Studio as an executable again.
This discussion has been closed.