Solved

Question about Sql Accounts and Deletion Management

Posted on 2016-09-21
1
60 Views
Last Modified: 2016-09-23
Question about Sql users.  I have a sql user that is added in the security section of the actual database.  I have the same user located in the instance level of security.  I deleted the user at the instance level but the user remained at the database level.  What is the proper way to delete a user if I totally want to rid the instance and all databases of this user login.

Also, all of the users in question should not be a owner of the database.

Question.... is there any danger in data being inaccessible after deletion of these users.

also, if i happen to delete a database owner..... i can always reassign that role to another user from an SA login.... Please verify.
0
Comment
Question by:jamesmetcalf74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 50

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 41808899
I have a sql user that is added in the security section of the actual database.  I have the same user located in the instance level of security.  I deleted the user at the instance level but the user remained at the database level.  
That's because the first is a SQL Login and the second a Database User.

What is the proper way to delete a user if I totally want to rid the instance and all databases of this user login.
Proper way is to delete both (Login and database user).
DROP LOGIN <loginName>
GO
USE databaseName
DROP USER <userName>

Open in new window


Question.... is there any danger in data being inaccessible after deletion of these users.
For user that user won't be able to access the data anymore but others users still can. Just be sure you let at least one login with sysadmin server role to fix the things if needed.

also, if i happen to delete a database owner..... i can always reassign that role to another user from an SA login
True. For that run the following:
USE DatabaseName
EXEC sp_changedbowner 'UserName'

Open in new window

1

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

736 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question