Forum Discussion
bruni-chue
Sep 22, 2023Copper Contributor
I need to run a large number of individual .sql files quickly
I have a large number of views and indexes that need to be built for our testing environment in a specified order. Up to now, we have just used one long .sql file that had the CREATE statements for t...
olafhelper
Sep 25, 2023Bronze Contributor
bruni-chue wrote: in a specified order.
Why in a specific order? The order of index creation doesn't matter in any way.
there was already a tool built into SSMS
Switch SSMS query editor to SqlCmd mode
sqlcmd utility - Edit SQLCMD scripts with Query Editor - SQL Server | Microsoft Learn
and load the .SQL files with ":r" command, see
sqlcmd utility - SQL Server | Microsoft Learn