question

MpriorJ avatar image
MpriorJ asked

Database User deleted

Hi all,

Very fresh MS SQL user calling. And I made horrible mistake, i am asking if possible to roll it back.

I am running MS SQL 2008 Developers edition. What I accidentally did is deleting the very one DB user on my local server!!!!! I have several DBs so it is very important to get back to my previous state.

Any chance? Please help me.

Thank you.

sqllogindeleteuser
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sp_lock avatar image
sp_lock answered

Did you take a backup?

Check "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA" (this may differ depending on your installation). It maybe that the mdf and ldf of the database are still in the data folder. If so you can try re-attaching the mdf

MSDN "Attach Database"

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image sp_lock commented ·
OK.. Wrong end of the Stick... Are you a member of the "Local Admin" group? If so if you included this when you installed SQL then it should enable you in? Where did you delete the user from? Logins or the specific database?
1 Like 1 ·
MpriorJ avatar image MpriorJ commented ·
My problem is I can not connect to the server itself. I have backups of my important DB, but not sure how can i use them when I can not connect to the DB server itself.
0 Likes 0 ·
MpriorJ avatar image MpriorJ commented ·
Yeah, I know it is really bad! I am member of all the admin groups in the network, but i never manage to add any other users to my local sever (the one on my PC) except mine. When I was deleting the user, the idea was to delete it from specific DB, but by mistake I delete it from the local server. If this helps, i CAN connect to other MS SQL servers in the network, but not my local one. To cut the story, I was wondering if there is any way to rollback the deletion?
0 Likes 0 ·
MpriorJ avatar image MpriorJ commented ·
It work with little bit effort. Thank you very, very much. You saved me a lot of troubles! :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.