I have a C# program which uses SMO to submit tsql to SQL Server 2008 R2 for execution. The tsql is read in from a script file and this works fine.
However if I give it a script file which contains some sqlcmd syntax I get an exception saying "Incorrect syntax near ':' .
Is it the case that SMO does not support script files with sqlcmd syntax?
If that is the case, please can anyone you suggest alternatives.