Home > Archive > MS SQL Server > February 2006 > The missing default db and a connection to SQL Server 2005 via a D









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author The missing default db and a connection to SQL Server 2005 via a D
Andrey Odegov

2006-02-17, 9:23 am

I receive an error when i try to connect to
SQL Server 2005 (SS2K5) via a DAC and an account
i use cannot get access to its default database.

Steps to reproduce the problem:

1. Log into SS2K5 with the sa account.

2. Create a database:

CREATE DATABASE StubDb;
GO

3. Alter the default database property of the
" BUILTIN\Administrato
rs" login to the StubDb
database:

SET QUOTED_IDENTIFIER ON;
ALTER LOGIN " BUILTIN\Administrato
rs"
WITH DEFAULT_DATABASE = StubDb;
GO

4. Drop the StubDb database:

DROP DATABASE StubDb;
GO

5. Use the trusted connection with
the BUILTIN\Administrato
rs account
to get access to SS2K5 via a DAC:

sqlcmd -A -E

The above call of the sqlcmd utility results in
the following error:

Msg 4064, Level 11, State 1, Server SVR-W2K3-64, Line 1
Cannot open user default database. Login failed.
Msg 18456, Level 14, State 1, Server SVR-W2K3-64, Line 1
Login failed for user 'SVR-W2K3-64\Administrator'.

Results are exactly the same for the sa account when the sa
and the BUILTIN\Administrato
rs accounts exchange the roles.

Is the kind of behaviour right?

The information returned by @@VERSION is as follows:

Microsoft SQL Server 2005 - 9.00.1399.06 (X64)
Oct 14 2005 00:35:21
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Evaluation Edition (64-bit)
on Windows NT 5.2 (Build 3790: Service Pack 1)
---
Andrey Odegov
avodeGOV@yandex.ru
(remove GOV to respond)

Andrey Odegov

2006-02-17, 9:23 am

I answer to myself I hope it could useful for other.
In that case, i have to use the sqlcmd utility specifying the -d option.
For example:

sqlcmd -A -U sa -d master

---
Andrey Odegov
avodeGOV@yandex.ru
(remove GOV to respond)


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com