hi,
I use the :r command in SQLCMD script to include anotherscript into the calling script. Just like this,
http://www.mssqltips.com/sqlservertip/1543/using-sqlcmd-to-execute-multiple-sql-server-scripts/
The problem is, I found that the :r command works fine until I move it into a IF or BEGIN TRY/END TRY statement. I.e., the :r command won't work if I enclose it within other statements.
Is it a known issue, or I've neglected something?
http://msdn.microsoft.com/en-us/library/ms162773.aspx say,
"If the file contains Transact-SQL statements that are not followed by GO, you must enter GO on the line that follows :r."
but I've done that.
Please help.
Thanks