• Here's what I use:

    1. In the folder where the SQL scripts as stored, create a file named mergescript.cmd.

    2. Open this file and paste this into it:

    @IF EXIST scriptdb.sql DEL scriptdb.sql

    FOR %%C IN (*.sql) DO TYPE %%C >> scriptdb.txt

    @REN scriptdb.txt scriptdb.sql

    3. When you execute mergescript.cmd, a file named scriptdb.sql is created (or replaced if one already exists). This file contains all the individual script files merged together.

    4. You can than load scriptdb.sql in SSMS or have it executed from the command line (osql, sqlcmd, etc.).

    Warning: If the different objects must be created in a defined order because of their dependencies, you'll perhaps need to prefix each individual source files with a numeric value (e.g. 01-Fn_Get_List_ID.sql, 02-Proc_Tbl_Reclamations_Update.sql because Proc_Tbl_Reclamations_Update uses Fn_Get_List_ID).

    Have a nice day!