Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
TDC
Starting Member
5 Posts |
Posted - 2009-02-16 : 09:14:28
|
| Hello, and thanks for reading this.I am developing a VB application (Visual Studio 2008) which is connected to a local SQL database (SQL Server 2008 Express on a standalone laptop). I call Stored Procedures from my VB code, passing any required arguments, to perform various data handling requests. This all works well.I now need to deliver the same application/database to different customer sites which will require different data in the database's Tables.At first I thought I would simply 'clone' the database, enter the new data and deliver the application. This would work, but then I would have several different database's deployed and if I updated or added a new Stored Procedure to one, to facilitate new functionality in the base application, the other databases would have to be updated to keep them in sync which I feel may be troublesome.Another option, which I have currently opted for, is to add the new Sites' data into the same global database and carefully SELECT the individual Site's data when needed. This allows me to deploy the same database to all sites if there is an update. The downside to this is it is difficult to manage individual Site's data because it has to be imported from Excel Workbooks and when the data changes, for example if there are some additional rows of data for one Site, then I have to be so careful to ensure that the Primary Key values stay the same after the import (this is because the Id values are stored in other working files and must point to the same row after the SQL update).Is it possible to either:Keep individual Site's data in separate Tables and use an IF statement, depending on the SiteId value passed in a Stored Procedure, to access the appropriate Tables.Create a SQL database just to hold the Stored Procedures and a separate database for each Site and, like above, call the appropriate database in the Stored procedure?Many thanks for getting this far!RegardsChris |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-16 : 09:18:06
|
| i would have thought of putting siteid as a column in your current tables and put new sites detail also there, so that you can always access the concerned sites data based on id. also you can create views for each site to get only relevant data and also give permissions to people in concerned site for accessing views. |
 |
|
|
TDC
Starting Member
5 Posts |
Posted - 2009-02-17 : 04:24:40
|
| Thanks for your thoughts.Using Views is a good idea. I will think carefully about how best to use them. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-17 : 09:10:14
|
| cheers |
 |
|
|
|
|
|
|
|