Is there an easy way to call one sql file from another?
We have 2 sql files - a.sql and b.sql for our products. Locally we create the db's A and B and then run a.sql an b.sql.
Now, there is another team that has been maintaining an sql file MasterFile.sql which is supposed to create all the dbs needed for this project and configure them. We now need to ensure that the contents of our sql files (a.sql and b.sql) are also called from this masterFile.sql.
Both a.sql and b.sql are subject to change in the near future and therefore we dont want to manually add the contents to MAsterFile.sql.
What is the best way to do this? I tried doing sqlcmd as well as source and :r a.sql, but none of them worked.