스크립트 및 SQL 작업이 포함 된 내 ssis 패키지 내에 for 루프 컨테이너가 있습니다.SSIS For Loop 작업 중지
나는 3 개 변수를 가지고있다.
source.string = this is folder location
file.string = i have used wildcard = *.csv
exist.int = defaulted to 0
내가 @로 설정 innitexpression 값이 = 1 을 존재 @로 설정 evalexpression 값이 나는 소스 변수에서와 file.string 경우보고를 설정 한 스크립트에서 = 1
을 존재 변수가 존재하면 변수가 1로 설정됩니다.
문제는 단지 루프입니다. 파일이 없으면 반복해야합니다. 위선자가 변수를 와일드 카드 *로 변경하기 전에 어떻게 잘못했는지 확인하십시오.
와일드 카드가 아닌 파일 이름이 포함 된 다른 변수를 사용하여 테스트 한 결과 올바르게 작동합니다. 파일 이름과 확장자 뒤에 와일드 카드를 찾을 때. 왜 이런거야? 와일드 카드 변수를 통과 할 수 있습니까? 내가이 개 다른 솔루션을 만들어 위의
내 스크립트 작업은 의견을
public void Main()
{
// TODO: Add your code here
string Filepath = Dts.Variables["User::Source"].Value.ToString()
+ Dts.Variables["User::file"].Value.ToString();
if (
File.Exists(Filepath))
{
Dts.Variables["User::Exists"].Value = 1;
}
/// MessageBox.Show (Filepath);
/// MessageBox.Show(Dts.Variables["Exists"].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
}
#region ScriptResults declaration
/// <summary>
/// This enum provides a convenient shorthand within the scope of this class for setting the
/// result of the script.
///
/// This code was generated automatically.
/// </summary>
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
}
}
는 당신이 우리 스크립트 작업 스크립트를 게재 할 수 있습니까? – plaidDK
@plaidDK가 질문에 스크립트 작업을 추가했습니다 – sql2015
경로가 어떻게 생겼습니까? – plaidDK