I am trying to execute a sql procedure for a list of tables in sqlcmd mode to redirect all the output into one file per table.
Unfortunately only the last file of the redirected outputs of all commands gets content.
For example I execute the following:
:OUT c:\test\tab0.sql
EXEC [dbo].[sp_generate_merge] @schema = 'dbo', @table_name ='tab0', @include_timestamp = 0, @ommit_images = 1, @CreateProcedure = 1
:OUT c:\test\tab1.sql
EXEC [dbo].[sp_generate_merge] @schema = 'dbo', @table_name ='tab1' , @include_timestamp = 0, @ommit_images = 1, @CreateProcedure = 1
Both files are created, but only the last file gets all the content.
Any hints how I can change this in order to get the results in one file per command?