SQL 2005 Login issue

  • Hi,

    We setup a login for Active Directory group on the server. But the members get an error when they try to create new database. The error says " Cannot open default database. Login failed for user."

    Now MSDB is set as the default database for this group.

    Creating the database using T-SQL works. So I am thinking that he error is associated with SSMS GUI only.

    Has anyone encountered this error? I googled and all references point towards setting 'Default database' which is already set.

    thank you

    Yogesh

  • Yoseph

    I did came accross issue with this in the past and the way I solved the login issue was by setting master database as the default database login.

    U can use the following T-SQL to create the login:

    CREATE LOGIN [DOMAINNAME\ADAccountName] FROM WINDOWS WITH DEFAULT_DATABASE=[master]

    Good Luck

    IT

  • I tried that. No luck.

  • Hi Yogesh

    Try this with sqlcmd:

    sqlcmd -d master -U sa -P mypassword

    and then:

    alter login sa with default_database = master

    IT

  • DId that. No luck either.

  • So if you login to SSMS with the sa account it is not allowed to create a DB either?

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply