Here is the actual dummy program
Can I ask a question about this, how to save data from different databases into one database (MainDatabase). It is possible right?
I just want to have an idea making a simple program that can retrieve data from multiple databases with the SAME table name e.g transactionTBL, and then save it to one database with the same columns and value. btw I did tried using a stored procedure - but it have to be an object not varchar or string.
@DATABASE varchar(50)
INSERT INTO UserControlTenant.dbo.tenantData (tenant_name, receipt_id, amount, date, time)
SELECT *
FROM ___.dbo.transactiondata
Example:
Database1
~transactiontbl~
ID
receiptID
amount
date time
Database2
~transactiontbl~
ID
receiptID
amount
date time
- MainDB
~transactiontbl~
ID
receiptID
amount
date time
