Skip to main content

New answers tagged

0 votes
Accepted

Same global user works local but fails on live server for information_schema database UPDATE query

If someone has a better answer, please, by all means, share it. That being said it looks like the problem is, again, cPanel. With everything else being the same there are some weird restrictions on ...
John's user avatar
  • 737
0 votes

Postgres view role permissions

This is a minor variation of a query that I've been using for listing database object grants. WITH relkinds AS ( SELECT * FROM ( VALUES ( 'c', 'type' ), ...
gsiems's user avatar
  • 3,323
0 votes

SQL Server Management Studio "Key cannot be null" error when giving a specific user permissions on Stored Procedures

The problem was that the stored procedures had Writes written into them, and the user was a Read Only account. This error doesn't really point to that, but make sure the user has permissions to ...
LYNITS's user avatar
  • 1
0 votes

error when re-applying the permissions script into the original database - sql server

Charlieface's anwer is the one I am going to accept, it is very good. The only reason I am posting here, it is because his query did not work on my environment mostly due to COLLATE issues,and I love ...
Marcello Miorelli's user avatar
2 votes
Accepted

error when re-applying the permissions script into the original database - sql server

You need to exclude internal tables using is_ms_shipped = 0. You also need to quote names correctly using QUOTENAME. You need to handle WITH GRANT OPTION correctly. You probably want to add AS ...
Charlieface's user avatar
  • 13.7k
3 votes
Accepted

How do I prevent a DB user to change table contents in SQL Server?

throw away db_owner permission and set a role with exactly what you need CREATE ROLE myspecialrole; GRANT SELECT ON schema :: [dbo] TO myspecialrole; GRANT INSERT ON schema :: [dbo] TO myspecialrole;...
MBuschi's user avatar
  • 4,615
2 votes

How do I prevent a DB user to change table contents in SQL Server?

This code will do it. DENY UPDATE ON dbo.AspNetUserRoles TO [Dbuser] GO DENY INSERT ON dbo.AspNetUserRoles TO [Dbuser] GO Details about deny syntax. Complete test code here: --Create a test database ...
SqlWorldWide's user avatar
  • 13.5k
1 vote
Accepted

How can I allow a user to alter tables they do not own in Postgres?

No, there is no way around that: only a member of the owning role or a superuser can ALTER or DROP an object. Perhaps you can make the user that is to drop the objects a member of all other users?
Laurenz Albe's user avatar

Top 50 recent answers are included