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 |
|
Kristen
Test
22859 Posts |
Posted - 2004-06-09 : 12:09:49
|
| Oops!I have an application that looks after Customers and Orders, and also Brand/Products/Catalogue/Prices and Web Content.We created a second site for a customer, and thus a second database. They need this to keep their display of products and HTML content separate for their two brands.But it turns out that opening an account for one of the brands entitles the user to shop for the other brand. I through they were completely different entities. So users needs to be able to log in to either web site and use/update their account etc.All access to the data is through [loads and loads and loads] or SProcs.I don't want to support two sets of, different, SProcs.Longer term we will merge the two solutions into one database but right now we have no way to segregate two "brands" in a single DB (maybe I could do with some magic you can suggest?), so I'm happy with a short term solution until we can combine into a single DB.So the question is am I daft, or is there a better way? ... I plan to put VIEWs in Database2 pointing to the Customer and Order tables in Database1 so that all that activity will take place in one database, and just the Products/Content will have tables in both DBs. My Sproc for, for example, SaveCustomerAddress will INSERT/UPDATE the CUSTOMER table, which will actually be a VIEW to the real DATABASE2.dbo.CUSTOMERI will probably have to weaken the security considerably to achieve this (both read&write access granted to the IIS user; maybe there is some cross-browser security I can use, but I've only heard about that, never tried it).Ideas on a postcard please ...Kristen |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-06-09 : 12:55:24
|
quote: I don't want to support two sets of, different, SProcs.
You may not want to, but that may be the easiest.Did you reference the database name in the sprocs?Always thought that doing that because of increased speed was not worth the loss of portability...If that's not it, then why do they need to be different?Brett8-) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-06-09 : 13:25:58
|
>> Did you reference the database name in the sprocs?Nope. But if I had of done I could just do a find&replace ...>> If that's not it, then why do they need to be different?'Coz now they have to access tables in the "other" database. Or (as I was planning) carry on accessing the local object, which will be a VIEW instead of a TABLE something like [i.e. without the "*"<g>]:CREATE VIEW MyTableNameASSELECT * FROM OtherDatabase.dbo.MyTableName Kristen |
 |
|
|
|
|
|
|
|