a. Master database has a table of periods (i.e. 201710)
b. There are sales databases for each month (i.e. sales_201710, sales_201709....etc)
c. Child database list is created using a view giving fully qualified name of the database.dbo.table.
How could we link them using a select list of periods (201710,201709, etc) in the master database with the sales database tables.
Main database : companyDB
child databases and a table : companyDB_201710.dbo.sales_201710.
there will be a sales table every month. This needs to be dynamically linked using the master database sales table which contains the summary.
I have tried to build the sqlwhere part giving variable period in child database list but did not work.
List page class:
private string _SqlFrom = "";
public string SqlFrom {
get { return ew_NotEmpty(_SqlFrom) ? _SqlFrom : "[CompanyDB_"+ Period.SessionValue + "].[dbo].[Sales_"+ Period.SessionValue + "]"; }
set { _SqlFrom = value; }
}
How do we achieve this?
Kind Regards
Zam