私はこのようなSSIS変数式を持っています、
@[System::PackageName]+","+
@[System::SourceName]+","+
(DT_STR,15,1252) @[System::ErrorCode]+","+
@[System::ErrorDescription]+","+
(RIGHT((DT_WSTR,4)
DATEPART("yyyy",GetDate()),4)+"/"+
RIGHT("0"+(DT_WSTR , 2)
DATEPART("mm", GetDate()),2)+"/"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("dd",GetDate()),2)+"_"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("HH",GetDate()),2)+":"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("MM",GetDate()),2)+":"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("SS",GetDate()),2))+","+
@[System::MachineName]
@[System::ErrorDescription]
ここで、前にある文字列を取得したいのですが、これが値at
のサンプルです@[System::ErrorDescription]
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\blablablabl\yes.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
私がやったことは、変数式に部分文字列コードを書くことです:
SUBSTRING(@[System::ErrorDescription], 1, FINDSTRING(@[System::ErrorDescription], "at", 1)-1)+","+
しかし、それは常に私にエラーを与えます、その部分文字列の値は負になることはできません、私のコードの何が問題になっていますか?