I have a database called ROOT with the common tables like companies, users, etc. and all the stored procedures that I need.
Then I have a unique database per company containing all their info.
How can I apply the stored procedures that I have on database ROOT to the tables on each company's databases ?
The TSQL USE command do not accept variables.
Thanks for your help,
MOsheOoh. I'd use one database and then put a company ID on everything. Other than that, I think you would have to use dynamic SQL for everything and use full object names database.owner.object. That would get to be a real pain. It'll also wreak havoc with permissisons since the execute permissions for the stored procedure won't allow you to access those objects unless the user has permissisons on the underlying objects themselves. Unless you're bound to multiple databases, I'd change that.|||Select * From [DataBaseName].[dbo].[TableName]sql
No comments:
Post a Comment