MarnickTelenet
Programmer
We have a web-application that connects through a SQL-user to a Microsoft SQL2005-database with certain rights on certain SQL-objects (for example: only that User Defined Function, only that Stored-procedure).
Sometimes we have to update some of those SQL-objects: new or extra code in a UDF or a SP... Our tool that creates the script (ApexSQL) does this update with first a DROP object and then a CREATE object. This is interesting because in that way we can directly see in the cliënt database the creation date of the object, which you can't see with an ALTER object (there is no update-date visible in the SQL2005 server management studio).
After this DROP/CREATE is done on the databases of our cliënts, the rights for the web-application SQL-user are gone.
What is the best solution for this?
Is it possible to make a stored-procedure named "RefreshSqlUserRights" that we run after every database-update? That stored-procedure re-assings the right rights on the right SQL-objects for that SQL-user?
Anyone experience with this problem?
Sometimes we have to update some of those SQL-objects: new or extra code in a UDF or a SP... Our tool that creates the script (ApexSQL) does this update with first a DROP object and then a CREATE object. This is interesting because in that way we can directly see in the cliënt database the creation date of the object, which you can't see with an ALTER object (there is no update-date visible in the SQL2005 server management studio).
After this DROP/CREATE is done on the databases of our cliënts, the rights for the web-application SQL-user are gone.
What is the best solution for this?
Is it possible to make a stored-procedure named "RefreshSqlUserRights" that we run after every database-update? That stored-procedure re-assings the right rights on the right SQL-objects for that SQL-user?
Anyone experience with this problem?