I have to grant REFERENCES
permission to a login say sql_login
.
I can give grant REFERENCES
permission to individual table like
GRANT REFERENCES ON Mytable TO sql_login
Is there any way to grant REFERENCES
permission to my login to all my tables or am wrong in any way
As it turns out, an explicit securable isn't needed in a GRANT
statement. That is, you can say:
GRANT REFERENCES TO [sql_login];
Note, that it's not just tables to which the REFERENCES permission applies. From the documentation, it also applies to:
I say that only so that you appreciate that you may be granting permissions on objects that you don't intend to with this approach. But the upside is that you won't have to manage these permissions ever again. That is, if/when you add a new table to your database, your user will automatically get the REFERENCES permission for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With