I have SQL Server 2000, not sure which SP. A db that I created 3+ years ago
has been running smoothly, but today, I cannot connect. Specifically, in
Enterprise mgr, when I click on the name in the tree on the left, or if I
right-click and select Connect, I get a message box which says:
"A connection could not be established to (nodename). Reason: cannot open
user default database. Login failed. Please verify SQL Server is running and
check your SQL Server registration properties by right-clicking the node and
try again."
So I verified that the SQL Server services were running in the Servies
dialog. I even restarted them. I right-clicked the node in Enterprise mgr,
and it won't show my anything in Properties. But when I selected "Edit
Registration Properties", it was a simple dialog with not much on it. I use
Windows authentication (this is a development server, and only I have access
to it), and the only other option is to change the server group, of which
there is only one.
I tried deleting the registration for this server, then re-adding, it, but
it wouldn't let me re-add. I should note that this was done from another
machine, as I didn't want to try deleting the node from the console on the
actual machine where this DB resides. It should be noted that I was getting
this error on both machines.
One more note: In order to copy this database over to another machine which
is running SQL Server 2005 Express, I detached the database a few days ago,
copied it over, and attached it. I thought I had re-attached it in this 2000
machine, but whether I did or didn't, I don't see a way to do it now.
I am at a loss. Any advice?
I should add one more thing. My ASP app which points to that database works
fine, and I have verified that it is pulling data from it. So my problem is
not rooted in failing to re-attach the database. I just cannot connect via
Enterprise manager.
|||> "A connection could not be established to (nodename). Reason: cannot open
> user default database. Login failed. Please verify SQL Server is running
> and check your SQL Server registration properties by right-clicking the
> node and try again."
Read the error message VERY carefully. Note the information about the
default database. It apparently no longer exists. Note that this really
isn't an error - only EM treats it as one. You can still access the server
using QA using the same credentials, where you can change the default
database (sp_defaultdb) to something that is valid. Alternatively, you can
change the EM registration to a login that works (or login as an
administrator with access to the server - if using integrated security) and
change the default database.
|||I can't make it work. Your post says that I can still get in via EM, but I
cannot. It gives me the same error. So I logged in using not my network ID
(because I'm using Windows authentication), but the web user's ID that I use
in my ASP connection string. And it let me in, but it wouldn't let me run
this query:
I tried running EXEC sp_defaultdb '*username*', '*dbname*'
because for username, I put in my Windows network login, and it says you
cannot change someone else's default database.
I have no idea what administrator name I have for this thing. It's been so
long, and I don't recall it asking me that question when I first created
this thing on this server.
|||>I can't make it work. Your post says that I can still get in via EM, but I
>cannot. It gives me the same error. So I logged in using not my network ID
Read the information I posted again. You will need to change the
registration in EM to use a different identity if you want to use EM to
change the default database. Otherwise, use isql (note - QA has the same
problem; I was wrong about that).
> (because I'm using Windows authentication), but the web user's ID that I
> use in my ASP connection string. And it let me in, but it wouldn't let me
> run this query:
> I tried running EXEC sp_defaultdb '*username*', '*dbname*'
> because for username, I put in my Windows network login, and it says you
> cannot change someone else's default database.
Yes - just what I would expect. Users shouldn't be able to change security
information, especially about other users.
> I have no idea what administrator name I have for this thing. It's been so
> long, and I don't recall it asking me that question when I first created
> this thing on this server.
Not much I can do about that. When you set up a server (or a database), you
should be documenting what options you choose just in case something "bad"
happens. If you are using mixed-mode security, you should be able to access
the server using the sa (or any other administrator-level) login (assuming
you still remember the password). Otherwise, you need to login to the
client with an administrator-level login to make these changes.
|||I was able to get in and make the change using sa. Thanks
No comments:
Post a Comment