Wednesday, March 7, 2012

Help! - detached default database....

Hope someone can help me with this. I am new to SQL Server and am using the
express edition. I detached my 'Default' database and now I can not connect
to the server and do anything! Short of uninstalling it and and reinstallin
g
it - have any ideas on how I can 'reset'?
TerryHi Terry,
I do not use the Express Edition but I think this should work. Use any of
the command line utilities to connect and specify an alternate database like
master. Something like this
sqlcmd -U user -P password -d master
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Terry" wrote:

> Hope someone can help me with this. I am new to SQL Server and am using t
he
> express edition. I detached my 'Default' database and now I can not conne
ct
> to the server and do anything! Short of uninstalling it and and reinstall
ing
> it - have any ideas on how I can 'reset'?
> --
> Terry|||Oops ... once connected user sp_defaultdb to change the default database of
your login like in
sp_defaultdb 'login', 'master'
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Ben Nevarez" wrote:
[vbcol=seagreen]
> Hi Terry,
> I do not use the Express Edition but I think this should work. Use any of
> the command line utilities to connect and specify an alternate database li
ke
> master. Something like this
> sqlcmd -U user -P password -d master
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "Terry" wrote:
>|||Hello Terry,
When you state Default database, do you mean the master database and othere
system database?
If so, you need to reinstall the sql express to rebuild the database.
Hope this helps.
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Since Terry was able to detach the database I assumed it was a user database
(system databases can not be detached).
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Wei Lu [MSFT]" wrote:

> Hello Terry,
> When you state Default database, do you mean the master database and other
e
> system database?
> If so, you need to reinstall the sql express to rebuild the database.
> Hope this helps.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>|||Thanks everyone!
It was not the master, it was one I developed and wanted to 'roll back'
to a backup I had made. And no, I couold not use the command line sqlcmd
utility to connect, and then make any change. SQL Management Express would
let me connect, but I could not do anything at all. I could not go to
security and and change the properties of my login. I could not re-attach
the DB - I was basically locked out of making any changes. The instance was
set up for 'Windows Authentication', so what I finally did was creat another
user (windows) on the system with Admin rights, logon to that account, log
into SQLME and change the default database for my original login. Took care
of the problem!
Thanks again for taking the time to try and give me some help - and Happy
Holidays!
--
Terry
"Wei Lu [MSFT]" wrote:

> Hello Terry,
> When you state Default database, do you mean the master database and other
e
> system database?
> If so, you need to reinstall the sql express to rebuild the database.
> Hope this helps.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>

No comments:

Post a Comment