New answers tagged

0

If the error ERROR: permission denied for relation migrations pops up when trying to do a GRANT ACTION, example:GRANT SELECT ON ALL TABLES IN SCHEMA schema_name to ro_user; ensure the GRANT is performed by the user that is the owner of the respective tables. Owner of schemas might vary within a database. Even postgres user will not be allowed to provide ...


0

Glad to hear that you were able to solve this with support from Microsoft. You could also run below query to check the grantor by running below command: select * from sys.database_permissions where grantor_principal_id = user_id ('User Name to be dropped'); Based on result you get from above command, you shall ...


0

I was able to solve this with the microsoft support team. When we delete the grantee server principal (so not the grantor, but the one who is granted the rights). After deleting the grantee server principal the granted rights disappeared. After that i could delete the grantor server principal. Add the deleted grantee principal back and assign the same right, ...


0

I have been given a task to set up a development database where all users able to access a given project schema (each project would have its own schema) would be able to do anything to any table, including to tables they do not own. That cannot work, as the documentation states: The right to modify or destroy an object is inherent in being the object's ...


0

I had similar problems, the answer was incorrect rules order in pg_hba.conf. Before: local all all peer local myuser mydb md5 since for local connections "all-all" rules was the first, and myuser with mydb was a part of that all, psql assumed that connection type is peer and denied me access. After local myuser mydb md5 ...


0

Not possible to do that, I'm afraid. There are only two special cases where you won't see all databases: You have deny view any database, and now you will only see the databases that you own. As you have already noticed. You login using contained authentication (directly against a user in the database instead of a login). This session is not sandboxed to ...


-1

You need to grant schema usage to user. GRANT USAGE ON SCHEMA "schema_name" TO role;


0

The nearest I could get was to follow these steps... Create DB1, t1, t2 And v1 As sysadmin With a SQL Server Login that has the sysadmin SQL Server Role create the database DB1, the tables t1 and t2 and the view v1. And don't forget database chaining. /******************************************* * Create Database DB1 ****************************************...


1

This might help in some way - check out the Permissions - ScriptLoginPermissions.sql here: https://github.com/aleksey-vitsko/Database-Administrator-Tools It creates stored procedure named ScriptLoginPermissions, you deploy it to any user database and then execute and supply login's name as parameter exec ScriptLoginPermissions 'LoginName' And it will script ...


2

I only tested this in Microsoft SQL Server 2017 (RTM-CU24) (KB5001228) - 14.0.3391.2 (X64) Apr 28 2021 10:32:18 Copyright (C) 2017 Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Datacenter 10.0 (Build 14393: ) (Hypervisor) Step 1 Create a stored procedure from the code you want to execute in each database. You will need to do it in ...


1

The script you are pointing to only works from SQL Server 2005-2016. There is a new one compatible with the latest version here.


Top 50 recent answers are included