now i have one customer that he want to buy 2 app (app1&db1----app2&db2)...it's well. but my problem is here that:
i have Emp table in my database that store Employee information.
for this customer i need 2 database for 2 app but i need the Emp table be the same in 2 database.
i search diffrent solutin and i need some help to use best solution:
1- using trigger to sync 2 tbl in 2 database==> it's not good becuse data in Emp tbl are too many and storing these data in 2 place is not googd suggestion.is't it?
2- access the Emp tbl data in only 1 database(using lnked server in sql server) ==> in this way i shuold change lots of my code...
i'm looking for a solution that i can have virtual table in db2 that is pointer to the Emp.db1!!!
1- using trigger to sync 2 tbl in 2 database==> it's not good becuse data in Emp tbl are too many and storing these data in 2 place is not googd suggestion.is't it?
If employee tables contain too many than you can use linked server to access it or create one webservice to fetch data from this database.
1- using trigger to sync 2 tbl in 2 database==> it's not good becuse data in Emp tbl are too many and storing these data in 2 place is not googd suggestion.is't it?
2- access the Emp tbl data in only 1 database(using lnked server in sql server) ==> in this way i shuold change lots of my code...
Hi,
Using linked server in SQL Server is the better solution of the above suggestions, You could try it.
Thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
reza141414
Participant
1571 Points
497 Posts
virtual table that gets it's value from diffrent database
Apr 30, 2012 09:12 AM|LINK
hi...
i have web app with sql database.
i sell my app to diffrent customers.
now i have one customer that he want to buy 2 app (app1&db1----app2&db2)...it's well. but my problem is here that:
i have Emp table in my database that store Employee information.
for this customer i need 2 database for 2 app but i need the Emp table be the same in 2 database.
i search diffrent solutin and i need some help to use best solution:
1- using trigger to sync 2 tbl in 2 database==> it's not good becuse data in Emp tbl are too many and storing these data in 2 place is not googd suggestion.is't it?
2- access the Emp tbl data in only 1 database(using lnked server in sql server) ==> in this way i shuold change lots of my code...
i'm looking for a solution that i can have virtual table in db2 that is pointer to the Emp.db1!!!
is it possible?
any suggestion plz?
dont forget to mark as answerd...
yrb.yogi
Star
14460 Points
2402 Posts
Re: virtual table that gets it's value from diffrent database
Apr 30, 2012 09:36 AM|LINK
If employee tables contain too many than you can use linked server to access it or create one webservice to fetch data from this database.
.Net All About
reza141414
Participant
1571 Points
497 Posts
Re: virtual table that gets it's value from diffrent database
Apr 30, 2012 09:46 AM|LINK
linked server is good suggestion but webservice is not because i use some join and sotoreprocedure in my database...
dont forget to mark as answerd...
yrb.yogi
Star
14460 Points
2402 Posts
Re: virtual table that gets it's value from diffrent database
Apr 30, 2012 09:55 AM|LINK
Linked Server is obviosly the best solution to get data from two different server's database.
If you are talking about the same, then go for linked server.
.Net All About
TabAlleman
All-Star
15557 Points
2698 Posts
Re: virtual table that gets it's value from diffrent database
Apr 30, 2012 02:21 PM|LINK
You mean a synonym?
http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/
Chen Yu - MS...
All-Star
21569 Points
2493 Posts
Microsoft
Re: virtual table that gets it's value from diffrent database
May 04, 2012 08:08 AM|LINK
Hi,
Using linked server in SQL Server is the better solution of the above suggestions, You could try it.
Thanks.
Feedback to us
Develop and promote your apps in Windows Store