Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
if an organisation is having more databases like singapore branch db,india db,malaysia db,

so before login user must select which db is he belongss to he/she can selct using dropdown r check box is it possible please help me to solve this
Posted
Updated 3-Jul-14 17:18pm
v2
Comments
syed shanu 3-Jul-14 22:42pm    
Will you have the same table names in all DB if so its simple.
declare @dbname nvarchar(255);
set @dbname = 'india db';
if @dbname = 'india db'
use india db;
else if @dbname = 'malaysia db'
use malaysia db;



apply this in your all SP you can pass the DB name as parameter to the SP(Stored procedures)

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900