Tag Info

New answers tagged

0

I've seen this before. I believe that it was due to autoclose. But I could not recall from memory. Credit here goes to Aaron Bertrand. Usually this means the login's default database is offline (perhaps due to AutoClose) or no longer exists. Resolve by fixing the missing database, or changing the login's default database using ALTER LOGIN (for older ...


1

We use below query to look for the logins mapped as user to specific databases. Hope it helps. CREATE TABLE #tempww ( LoginName nvarchar(max), DBname nvarchar(max), Username nvarchar(max), AliasName nvarchar(max) ) INSERT INTO #tempww EXEC master..sp_msloginmappings -- display results SELECT * FROM #tempww ORDER BY dbname, username ...


1

The query below will return the schema owner information. You can change the JOIN to sys.database_principals to a LEFT JOIN to also return schema owners that are not logins, such as database roles and users without a login. SELECT sp.name AS OwningLogin , dp.name AS OwningUser , s.name AS SchemaName FROM sys.schemas AS s JOIN ...


0

You must use Windows Domain logins and create them in every instance, As the SID is manage by active directory you will be able to access in all replicas members of availability group if the login exist in the primary replica. another option you must use a certificate.


2

Off guess you are missing the connect permission. I'd always thought that was created with the user but there may be conditions where it isn't added. Try running USE [MyDatabase]; GO GRANT CONNECT TO [MyDomain\MyAccount]; You could also try changing the default schema of [MyDomain\MyAccount] ALTER USER [MyDomain\MyAccount] WITH DEFAULT_SCHEMA = ...



Top 50 recent answers are included