I am currently working on a custom timer job to provide some basic archiving functionality for one of our SharePoint sites. Whilst doing this I have come across a few problems when you use a feature receiver to install the Timer Job for you, Molnar Tibor has a useful blog post explaining the problems and solutions -
I will explain them here too for clarity:
1.When you active the feature you may receive the following error:
System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object ‘proc_putObject’, database ‘SharePoint_Config’, schema ‘dbo”
The means that the web app’s application pool account does not have the correct access to the SharePoint Config database. You will need to set the correct permissions in SQL Management Studio – security admin permissions should be ok.
2.After you have completed the above, the code for deleting the timer job will throw an exception –
Access to the path ‘C:Documents and SettingsAll UsersApplication DataMicrosoftSharePointConfig360c4621-fccb-4c2a-9182-b3c75ae80cf3cache.ini’
In order to solve this you need to give the WSS_WPG account full control on the folder that contains the cache.ini file, in this case ‘360c4621-fccb-4c2a-9182-b3c75ae80cf3’.
Hope this helps!