Hi Team, I have been working with SQL for quite some time. I am looking out for some dynamic solution if any one can help me out. Below is the scenario. I am have 10 users, For whom I create database based on space constraint. All the database have common execution pack i.e. stored procedure , tables , function etc. At every user creation I create database at run time say (db1, db2, db3 ...... db10). To avoid having multiple script (stored procedure) in all db i created a masterdb which holds the business logic. When ever I insert or delete or update data in db1. My masterdb sp should get trigger and must process the data for respective users database. Can any one guide me how can I handle this. Cheers
Maybe not a useful answer for you but I would prefer to have the "multiple script (stored procedure)" duplicated in every database. That way, the procedure always "knows" which database to execute against - the local one (db1 in your example). In order for a trigger on a table in db1 to call a stored procedure in masterdb but still have it execute against tables within db1, the stored procedure in masterdb needs to execute its statements dynamically - injecting the the appropriate database name into the command at runtime. Surely achievable, but quite a security and maintainability headache.