1
vote
1answer
62 views

Copy SQL Logins and Permissions From One Server to Another

I need to duplicate all Logins and their associated database-level permissions from one server to another. I am using SQL Server 2008 R2 for Server A and SQL Server 2012 for Server B I am able to find ...
1
vote
1answer
30 views

SQL Server Builtin Logins Migration

I am in the process of scripting existing SQL Server 2008R2 logins for migration to a new server instance. I see that the existing logins contain the below... Windows Groups: ...
3
votes
2answers
195 views

Database User not reported as orphaned after Windows login dropped

I have dropped a SQL Server Windows Login. I then ran the below code to check for orphaned database users. However, the database user corresponding to the dropped Windows login does not appear as an ...
1
vote
2answers
63 views

ownership of users

Two related questions: Using SQL Server 2012, how does one find out who/what owns a user, and how can you set the ownership for users, if at all? To add a couple of questions: 'how to' for both of ...
1
vote
2answers
4k views

Connect to SQL Server with Windows Authentication in a different domain

I am trying to connect to a remote SQL Server on a VPN in a different domain. When I enter the Server name on the SQL Server and choose Additional Connection Parameters to add some extra stuff needed ...
1
vote
1answer
97 views

Create USER and LOGIN permissions

What permission should I give to a user or role so that it can Create Login or Create User in database.
3
votes
1answer
318 views

SQL Script to Drop old AD logins, Inactive SQL Logins and all related Users

Related Question: SQL Server script to delete accounts no longer in Active Directory Whilst the above question points out the rather handy sp_validatelogins procedure, i'd like to extend this ...
1
vote
1answer
87 views

What is the purpose of a user's default database?

As I understand it the default database is specified so that in case you don't specify one in the connection string, it will know where to start. Is this correct? I've never seen a connection string ...
1
vote
1answer
191 views

sp_setapprole and creating users / logins

We have set up SQL Server and our Application in such a way that an SQL Server login has … well no permissions when accessing the database using any tool, except our application. This is needed ...
4
votes
2answers
299 views

Why shouldn't a pre-hashed password be used with CREATE LOGIN all the time?

(For the purpose of this question, assume that I only need to support SQL Server 2008 and higher. Or to future-proof this question, let's say recent, current, and near-future versions.) The ...
0
votes
1answer
826 views

Sql Server Fix Users

I Create a user in my database with following command : CREATE USER Test WITHOUT LOGIN I created a login with the Test Name. I want to link Test user with Test Login. When I use following command ...
2
votes
2answers
2k views

Unable to access sql database with login and password [closed]

I'm writing Windows Service in C# and inside of it I'm unable to connect to the database. This is the question I've asked recently: SqlException: Cannot open database "path\db.mdf" requested by the ...
2
votes
2answers
70 views

How to revert multiple impersonations?

When there are nested impersonations (as in exec as user = 'user1'; exec as user = 'user2'; exec as user = 'user1';), is there a way to revert all of them without having to use the revert command ...
2
votes
1answer
552 views

Are passwordless logins like ##MS_SQLResourceSigningCertificate## , ##MS_AgentSigningCertificate## a vulnerability?

I'm new to MS SQL Server. Colleagues working in IT security, have run an scan showing come DB users with null password. Some of them are ( # included ) ##MS_SQLResourceSigningCertificate## ...
1
vote
0answers
146 views

how can Audit All Login To SQL Server BY ODBC Connection

I MAke Report By Access Form On SQL database I make ODBC Connection For login To Update the data From Database Now I want Audit All logins To know who make Update today Or who make Update Now ? ...
0
votes
1answer
1k views

Add user to sql server with the required permission

In my sql server express 2008 r2 i have about 15 login account. Now i want some about 5 users have full permission while some other 5 users with limited access to some database, and other users only ...
6
votes
1answer
6k views

The login already has an account under a different user name

When I execute this SQL: USE ASPState GO IF NOT EXISTS(SELECT * FROM sys.sysusers WHERE NAME = 'R2Server\AAOUser') CREATE USER [R2Server\AAOUser] FOR LOGIN [R2Server\AAOUser]; GO I get the ...
3
votes
1answer
434 views

SQl Server 2008 R2 - sa can login but not access database

Up until this morning I had no problems accessing our database. This morning, something has changed and I can no longer access our database (called EMS_Main) using the sa login. I can log into the ...
5
votes
4answers
3k views

SQL Server script to delete accounts no longer in Active Directory

We have a SQL Server 2000 that will shortly be migrated to SQL Server 2005. It has years of Windows Authentication accounts created that no longer exist in Active Directory, which prevent the Copy ...
2
votes
2answers
371 views

How to login in database if we have lost password? [duplicate]

Possible Duplicate: gain admin access to sql express 2008 Is there any idea if we lost our password to login in database using sql express management studio? Is there any place where ...
4
votes
1answer
1k views

How to link users and logins in an Availability Group?

I've got an Availability Group going and need to map some logins to database users on an active secondary replica. (Node2) Unfortunately, when I try to exec sp_change_users_login or alter user with ...
5
votes
2answers
3k views

Logins aren't syncing across Availability Groups

We have 2 servers in an AlwaysOn group. While the user accounts within each synchronized database exist on both servers, the database instance level logins only exist on one of the servers. Ie ...
7
votes
1answer
8k views

Login failed for user - Error 18456 - Severity 14, State 38

Message that SQL Server Log File Viewer shows: Login failed for user [User] Error: 18456, Severity: 14, State 38 What it actually means: Failed to open the explicitly specified database My ...
4
votes
2answers
599 views

Integrated Security Success on Master, Fails on Other Database

I'm a bit perplexed as to why my connection string is selectively succeeding on the master database in SQL Server 2005. Here are the details of my app. Any ideas where to look? I'm clearly missing ...
6
votes
4answers
2k views

T-SQL command to log in as a different user?

Is there a T-sql command, like the Oracle "Connect" which lets me change the user that I am logged in as?