Cannot apply equality in SQL Data Tools scripts.
Purpose: Establish a variable to use as a graceful exit when nothing needs to be done
ERRORS
"Operator '==' cannot be applied to operands of type 'bool'"
Only assignment, call, increment, decrment, await, and new object expressions can be uses as statement
CODE:
String recfil=Dts.Variables["User::FolderPath"].Value.ToString() + Dts.Variables["User::RecfileName"0.Value.ToString();
int recfilExists=Convert.ToInt32(File.Exists(recfil));
bool goodRun = irecfilExists.Equals(1)
bool noRun = irecfilExists.Equals(0)
if (goodRun)
{
Dts.Variables["User::NothingToDo"].Value == goodRun;
Dts.TaskResult = (int)ScriptResults.Success;
}
else
{
Dts.Variables["User::NothingToDo"].Value == noRun;
Dts.TaskResult = (int)ScriptResults.Failure;
}