A
ad
I want to use SqlCommand.ExecuteNonQuery to execute a Sql which is read from
a text file.
I want to sql to update a record in myTable, and alter a procedure.
The text file is like:
--------------------------------------------------------------------------------
UPDATE myTable set Col1='text'
ALTER procedure [dbo].[EmptyData]
as
Delete from Acc;
Delete from BodyMind;
Delete from Checks;
Delete from CheckTemp;
--------------------------------------------------------------------------------
when I execute the ExecuteNonQuery, it result into an error: The Alter
command must in the first line.
But if I put the Update command at last line, it become a part of the ALTER
procedure.
How can I udpate and alter procedure at once.
a text file.
I want to sql to update a record in myTable, and alter a procedure.
The text file is like:
--------------------------------------------------------------------------------
UPDATE myTable set Col1='text'
ALTER procedure [dbo].[EmptyData]
as
Delete from Acc;
Delete from BodyMind;
Delete from Checks;
Delete from CheckTemp;
--------------------------------------------------------------------------------
when I execute the ExecuteNonQuery, it result into an error: The Alter
command must in the first line.
But if I put the Update command at last line, it become a part of the ALTER
procedure.
How can I udpate and alter procedure at once.