Ok, since SQL Server 2016 we have new server-level permissions that allow to grant connect and select to/on any exising or future databases on the server instance use master  grant connect any database to [Login] grant select all user securables to [Login]  Tried to run below command: grant insert all user securables to [Login]  But it throws an error Is there any permission or role, or other method that grants permission to insert, update, delete (db_datawriter), or create objects inside user databases (db_ddladmin) on a server level - so it applies to all existing and future user databases ? So DBA does not have to go in and update permissions whenever new database is added ?
84178
When I setup my database I create a sql user that my application runs as.  The sql user gets read only access to all the databases on the server. The problem is the user won’t have read only access to any new created databases in the future. There is another app that creates these new databases for users and I don’t have a way to add my user script into the templates database created.  Is there a way to automatically update the sql user for read only for the future ones?  SQL server 2014.
45689
My account, david, is in the Administrators group on a Windows 7 machine.  I am still having problems with programs that I should be able to use, such as SQL Server. Specifically, my account seems to not have correct permissions when I am working.  I know with an Administrator account I should have full access. How can I force my account (david) to act like an admin account and have full access to everything?
83751
When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown.  These tables have execute permission for the schema where the view was created.  If I execute the view's SQL Statement it works.  What am I missing?
59852
Earlier I created a user :  SQL&gt;create user suhail identified by password SQL&gt;User created. SQL&gt;Grant create session,create table to suhail; SQL&gt;Grant Succeeded.   but when I login as suhail and try to create a table I get an error saying ORA-01950: no privileges on tablespace 'SYSTEM' .  What error is it ? Why does it occur ?    SQL&gt; connect suhail Enter password: Connected. SQL&gt; create table suhail_table(name char(10)); create table suhail_table(name char(10)) * ERROR at line 1: ORA-01950: no privileges on tablespace 'SYSTEM'   I am using Oracle Database 11g Express Edition Release 11.2.0.2.0
16619
I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus:      create user $blah identified by $password;    grant resource, connect, create view to $blah;   I want Bob to have complete access to Alice's schema (that is, all tables), but I'm not sure what grant to run, and whether to run it as sysdba or as Alice.  Happy to hear about any good pointers to reference material as well -- don't seem to be able to get a good answer to this from either the Internet or "Oracle Database 10g The Complete Reference", which is sitting on my desk.
66265
I'm test-running a Joomla installation (locally, using WAMP) with an MySQL database supporting it...this is in preparation to moving everything online once I have it configured.    I was working in phpMyAdmin to change the password of a superuser I had set up with a login-name other than "root."  While doing so, I saw three additional "root" users, and on the phpMyAdmin home page, a warning about these root users not having a password.  I thought that since I created my own superuser with "All Privileges," I didn't need the root users...so I deleted them.  Immediately things stopped working...and now, when I click on the "Users" tab in phpMyAdmin, it simply returns a red bar that says "No Privileges"...my specific superuser is gone.  However, it seems I can still move around in phpMyAdmin (maybe because I'm still logged in?).  Could someone please tell me step-by-step how (if?) I can re-add the root users using phpMyAdmin?  I see instructions posted in various places, but they seem to address users who are using terminal windows or some other program.  I'd  hate to see months of work go down the drain!  EDIT:  Using Windows, I've tried the following:   There is no file called "resetroot.bat" anywhere in the wamp/sql folders, as someone suggested...so that option is out.  I've tried to access MySQL using a terminal connection:  in the MySQL root folder there is a file called mysql.exe that seems to grant this when executed (there is no "mysql_safe.exe" as some solutions have suggested).  However, I have been unsuccessful in starting mysql with the --skip-grant-tables option from outside mysql.exe, and when I try to do it from within mysql.exe, I just get an odd prompt ("->") and no other commands seem to work.   Please keep in mind that I am a newbie at this!  I am trying different things, but without any success...that is why I'll probably need step-by-step instructions.
85289
Is there a way to provide access to users in my database to execute  msdb.dbo.sp_send_dbmail without needing to add them to the MSDB database and the DatabaseMailUserRole?  I've tried this:  ALTER PROCEDURE [dbo].[_TestSendMail] (   @To NVARCHAR(1000),   @Subject NVARCHAR(100),   @Body NVARCHAR(MAX) ) WITH EXECUTE AS OWNER AS      BEGIN         EXEC msdb.dbo.sp_send_dbmail @profile_name = N'myProfile',             @recipients = @To, @subject = @Subject, @body = @Body     END   But I get this error:  The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.   Thanks!
110884
I have a MySQL Community database on a remote server and I am trying to get Microsoft Access to read data from it. This data is sensitive. The problem is, MySQL doesn't care about the username that I give it in the .DSN file. It lets me read the ENTIRE database no matter what! How do I get it to actually check the username that I give it in the .DSN file?  edit: I'm not a DBA, I'm some intern who is over his head. Please don't assume that I know anything about anything  :)
3643
I've searched around all over and haven't found a conclusive answer to this question.  I need a script that can give ALL permissions for an associated role.   Any thoughts, or is it even possible?  This gets me CLOSE - but I can't seem to flip it around and give the summary for roles, rather than users.     WITH    perms_cte as (         select USER_NAME(p.grantee_principal_id) AS principal_name,                 dp.principal_id,                 dp.type_desc AS principal_type_desc,                 p.class_desc,                 OBJECT_NAME(p.major_id) AS object_name,                 p.permission_name,                 p.state_desc AS permission_state_desc         from    sys.database_permissions p         inner   JOIN sys.database_principals dp         on     p.grantee_principal_id = dp.principal_id ) --role members SELECT rm.member_principal_name, rm.principal_type_desc, p.class_desc,      p.object_name, p.permission_name, p.permission_state_desc,rm.role_name FROM    perms_cte p right outer JOIN (     select role_principal_id, dp.type_desc as principal_type_desc,     member_principal_id,user_name(member_principal_id) as member_principal_name,    user_name(role_principal_id) as role_name--,*     from    sys.database_role_members rm     INNER   JOIN sys.database_principals dp     ON     rm.member_principal_id = dp.principal_id ) rm ON     rm.role_principal_id = p.principal_id order by 1
66411
This seems to be a stupid question but despite some research I was unable to find any information regarding this only (possibly due to using the wrong terminology).  Is it possible to log multiple server logins (sql server authentication) to a single database user (which has permissions assigned by being member of a database role)?  I have dozens of sql logins (sql server authentication) which need to read one setting from a central database and I'd rather map all these logins to a single DB user in the target database than create an own DB user for each login.  If yes, what would be the correct T-SQL syntax?
4736
I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated.
64340
I get the command set identity_insert table_name on;, but for some reason it is not actually changing the attribute. I've done it with the account that I created the table with, and I've also created an 'admin' account and gave it permissions to do anything (to the best of my knowledge).    Whenever I run the command under either account I get the result of '0 rows affected', then I am unable to run the query to insert the rows I wish to insert with the following error:     Cannot insert explicit value for identity column in table 'table_name' when IDENTITY_INSERT is set to OFF.     Additionally I've tried to include the schema name in the query like:  set identity_insert mySchema.table_name on;    but I get the following error:     Cannot find the object "mySchema.table_name" because it does not exist or you do not have permissions.   Also of note, my project looks like:  localhost\SQLEXPRESS -Databases --System Databases --mySchema   Does anyone know a solution to this problem?
30067
I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?  EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.
6636
I am using , and want to use it to execute the checks on all of my SQL Servers and have it write the results to a single table.   Do I need to create linked servers on the central instance to connect to the other instances, or is there some other way to input the server names into the sp_Blitz stored procedure?
57327
I have a problem with ALTER DEFAULT PRIVILEGES. I grant the permission:  ALTER DEFAULT PRIVILEGES      FOR USER user_name     IN SCHEMA schema_name     GRANT SELECT ON TABLES TO user_name;   in next step I create a table  create table schema_name.a (q int);   Now, I connect to dabasabe using conn_user and try to read the data in the new table.   select * from schema_name.a   and I receive the error:  SQL Error [42501]: ERROR: permission denied for relation a   org.postgresql.util.PSQLException: ERROR: permission denied for relation a   Do you have any ideas why the error appears?
119469
Is it true that it is IMPOSSIBLE to create a readonly backup user in PostgreSQL?  I've been advised on an IRC channel that you simply can't have a backup only user with no ownership privileges.  I find it very strange so I want to make sure I'm not missing something.  Below is what I tried but it doesn't give me the results I'm looking for.  When I do pg_dump on a given table I'm getting Permission denied for relation...:  GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup;  ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO backup;  GRANT SELECT, USAGE ON ALL SEQUENCES IN SCHEMA public TO backup; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, USAGE ON SEQUENCES TO backup;   Any help would be greatly appreciated!
60495
I am using sp2013 foundation. I try update sp with this sp: sharepointsp2013-kb2880551-fullfile-x64-en-us  I installed the sp and finished. I did a reboot. After the reboot I start the wizard. I press a couple of times on next and the I saw a progress bar. After 2 seconds I got this error:  The INSERT permission was denied on the object 'Locks', database 'SharePoint_Config'  This is the full error:  Task initialize has failed with an unknown exception  06/26/2014 14:52:31  9  ERR                  Exception: System.Data.SqlClient.SqlException (0x80131904): The INSERT permission was denied on the object 'Locks', database 'SharePoint_Config', schema 'dbo'.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)    at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()    at System.Data.SqlClient.SqlDataReader.get_MetaData()    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite)    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean asyncWrite)    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, Boolean retryForDeadLock)    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command)    at Microsoft.SharePoint.Administration.SPLock.Acquire(SqlSession sqlsession, SPLockType type, String objectname, Guid&amp; lockid, String&amp; server, String&amp; commandline, Boolean force)    at Microsoft.SharePoint.Upgrade.SPManager.AcquireFarmUpgradeLock(Boolean bForce, Boolean singleClickInstall)    at Microsoft.SharePoint.PostSetupConfiguration.InitializeTask.Run()    at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask() ClientConnectionId:9f1f69eb-dc64-4ba7-9a5d-60daca7e5c21 06/26/2014 14:52:31  9  INF                  Entering function Common.BuildExceptionMessage 06/26/2014 14:52:31  9  INF                    Entering function StringResourceManager.GetResourceString   What is this, I logged in with farm account.