September 5, 2007 at 5:24 am
My application uses tempdb database and as my application has a sql user applied, i have given db_owner rights to the user on tempdb. Now when the sql server restarts, tempdb gets recreated and as a result the user access on tempdb gets removed.
Can anyone have some solution on how to keep the user access on tempdb after sql server restarts apart from applying user access on model database.
Thanks.
September 5, 2007 at 5:44 am
Ashish,
using sp_procoption you can set a stored procedure to execute at startup. So just create stored procedure which would add you user to the tempdb and then set the option.
Another possibility is scheduling a job to execute the script as soon as the SQL Agent starts. Of course this is depending on the SQL Agent service starting, while the first option don't need SQL Agent.
Markus
[font="Verdana"]Markus Bohse[/font]
September 5, 2007 at 5:51 am
Thanks Markus, this is absolutely life saving, as i thought of the 1st option but didnt knew how to execute SP at startup.
Thank you very much.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply