I have recently started working on a web application at a new company and am starting to bring in a few changes, for instance all my new code uses stored procedures rather than using a querystring in the code behind.
I recently discussed using Database schemas with my supervisor to tidy up our database and keep things manageable. The application I am working with is an intranet ASP.Net site with multiple sections for each department, I would like to implement a schema for each department so it is clear which procedures / tables belong to which parts of the application.
My question is would it be bad practice to add new tables / procedures etc into a database schema but leave everything else as it is then slowly add the existing tables to schemas? Or should we go through and add everything to schemas in one go?
Also is there any risk (performance or otherwise) to having some tables within a schema and some just within the database as they are now?
Sorry for what is probably a rather simple question but I’m not a DBA and have struggled to find any answers about this so far.
Thanks
I think the incremental/refactoring approach of moving to schemas as you go is a fine approach. I see no performance issues from it. The biggest issue will be remembering to start schema qualifying your objects (which you should be doing anyway even today as it is a best practice for performance)
instead of
If you are consistent with your schema qualifying you should be fine. If you get lazy with it, you’ll end up having more troubleshooting to do.