Is it possible in C# to execute multiline SQL statement in one call without creating Stored Procedure with this SQL?
Here is what I am trying to do:
string mySQL = "with CTE_table as (....)" +
"select name from CTE_table where ...." ;
_sql_Command = _sql_conn.CreateCommand();
_sql_Command.CommandText = mySQL ;
SqlDataReader dataReader = _sql_Command.ExecuteReader();
if (dataReader.Read())
{
...
I found a suggestion to separate SQL by ";", in this case I am getting a syntax error
Thanks,
zb