I have to process a file that contains a large number of sql statements. The issue is that the sql statement contain parameters.
E.g. the file looks like this
declare @var1 as nvarchar;
set @var1 = 'value';
insert into table (field1, field2, field3)
values ('value1', 'value2', @var1);
repeates with the next set of three lines.
I was hoping that I would just be able to parse the file into three line blocks and fire them off using the ExecuteNonQuery, however the problem is that the sql statement contains a parameter.
Note: In my example @var1 is value in the script it picks up a server variable.