November 25, 2011 at 4:05 am
Hello,
The company I work for are running SQL Server 2005. We have some views setup but they keep losing there permissions. So we are having to assign permissions time after time which as you can probably imagine is not ideal.
Is there anybody who can help with this and maybe help me understand why this is a) happening in the first place and b) a potential fix/work-a-round.
Many thanks,
November 25, 2011 at 6:17 am
Permissions don't "get lost", but may be revoked by something:
1) Explicit REVOKE commands
2) Drop / re-create view
Personally, I would investigate the drop/re-create as the most likely cause, then I would modify the create statement to include the GRANT commands needed or change it to an ALTER VIEW.
Hope this helps
Gianluca
-- Gianluca Sartori
November 25, 2011 at 6:37 am
Ok brilliant thanks for your reply. I will have a look into this and report back.
November 30, 2011 at 2:15 am
Gianluca Sartori (11/25/2011)
Permissions don't "get lost", but may be revoked by something:1) Explicit REVOKE commands
2) Drop / re-create view
Personally, I would investigate the drop/re-create as the most likely cause, then I would modify the create statement to include the GRANT commands needed or change it to an ALTER VIEW.
Hope this helps
Gianluca
Gianluca,
I have spent some time looking into this and myself and my manager both don't think this is the cause tho we could be wrong. Another thing I should mention is we created a command so that every saturday the server rebuilds the indexes.
Could this be an issue?
Many thanks,
November 30, 2011 at 2:25 am
Swagger187 (11/30/2011)
Gianluca Sartori (11/25/2011)
Permissions don't "get lost", but may be revoked by something:1) Explicit REVOKE commands
2) Drop / re-create view
Personally, I would investigate the drop/re-create as the most likely cause, then I would modify the create statement to include the GRANT commands needed or change it to an ALTER VIEW.
Hope this helps
Gianluca
Gianluca,
I have spent some time looking into this and myself and my manager both don't think this is the cause tho we could be wrong. Another thing I should mention is we created a command so that every saturday the server rebuilds the indexes.
Could this be an issue?
Many thanks,
No, rebuilding indexes will have no effect on views.
I recommend creating a database trigger to capture DDL events and log them to a table. This will make it obvious what is going on.
good luck.
November 30, 2011 at 2:27 am
SpringTownDBA (11/30/2011)
Swagger187 (11/30/2011)
Gianluca Sartori (11/25/2011)
Permissions don't "get lost", but may be revoked by something:1) Explicit REVOKE commands
2) Drop / re-create view
Personally, I would investigate the drop/re-create as the most likely cause, then I would modify the create statement to include the GRANT commands needed or change it to an ALTER VIEW.
Hope this helps
Gianluca
Gianluca,
I have spent some time looking into this and myself and my manager both don't think this is the cause tho we could be wrong. Another thing I should mention is we created a command so that every saturday the server rebuilds the indexes.
Could this be an issue?
Many thanks,
No, rebuilding indexes will have no effect on views.
I recommend creating a database trigger to capture DDL events and log them to a table. This will make it obvious what is going on.
good luck.
Thanks for the speedy reply. I will do this and see what happens.
Thanks,
November 30, 2011 at 11:51 pm
Check the create_date in the sys.views.
If it is newer than the date the view was deployed, it means the view was DROPped and reCREATEd.
December 2, 2011 at 9:37 am
You can also start a Profiler trace to get more information with events on that view object. There are a couple of event categories that may be worthwhile to look into, Security Audit and Objects. Specifically, there is an event class under security audit titled "Audit Database Scope GDR Event." See if this yields any clues.
----------------------------------------------------
December 5, 2011 at 1:48 am
Morning all,
I have looked into doing what you guys have recommended but being a novice in SQL I haven't been able to do any of them 🙁 embarressing (creating tables and creating simple triggers to sit on tables is as much as I can do).
I have however enable the public permissions on the views and that seems to have worked where as the Builtin users permissions have been revoked again. I will now start learning how SQL works so if these public permissions share the same fate as the builtin then I am in a position to be able to carry out some of the things you guys have recommended.
Many thanks,
Swagger
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply