x

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.

more ▼

asked Mar 29 '10 at 06:33 AM in Default

MpriorJ gravatar image

MpriorJ
12 1 1 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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"

more ▼

answered Mar 29 '10 at 06:43 AM

sp_lock gravatar image

sp_lock
9k 24 27 30

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.
Mar 29 '10 at 06:50 AM MpriorJ

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?
Mar 29 '10 at 06:57 AM sp_lock

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?
Mar 29 '10 at 07:05 AM MpriorJ
It work with little bit effort. Thank you very, very much. You saved me a lot of troubles! :)
Mar 29 '10 at 08:40 AM MpriorJ
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x673
x81
x51
x30

asked: Mar 29 '10 at 06:33 AM

Seen: 1800 times

Last Updated: Mar 29 '10 at 06:33 AM