在我的 SSIS 2005 包中,我需要通过表达式提供 FTP 连接字符串,因为我需要从 dtsConfig 文件中为用户配置它。
目前我尝试给出以下表达式:
Connectionstring = @[User::FTPServer] + "."+ @[User::FTPUser] + "."+ @[用户::FTPPass]
对于这种独特的语法,我从 http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/3713e9a5-343a-4c5b-ac5d-1508cd5ab8be 的讨论中获得了一些建议。
我的 FTPServer 变量也有格式为 MYSERVERNAME:21 的端口信息。
但我收到错误“530 匿名用户未知”
知道如何解决此错误吗?
最佳答案
我认为你的变量应该有两个 ::
不是一个。@[User::FTPServer] + "." + @[User::FTPUser] + "." + @[User::FTPPass]
编辑:
您可能会因为 password being cleared 而遇到一些麻烦
我要做的是通过脚本任务预先设置这些细节。运行脚本,然后运行 FTP 任务 - 我认为这应该可行。
Public Class ScriptMain
Public Sub Main()
Dim FTPConnectionManager As ConnectionManager
'Set variable to an existing connection manager
' Replace "FTP Server" with the name of your existing FTP Connection Manager
FTPConnectionManager = Dts.Connections("FTP Server")
FTPConnectionManager.Properties("ServerName").SetValue(FTPConnectionManager, Dts.Variables("FTPServer").Value)
FTPConnectionManager.Properties("ServerPort").SetValue(FTPConnectionManager, Dts.Variables("FTPPort").Value)
FTPConnectionManager.Properties("ServerUserName").SetValue(FTPConnectionManager, Dts.Variables("FTPUserName").Value)
FTPConnectionManager.Properties("ServerPassword").SetValue(FTPConnectionManager, Dts.Variables("FTPPassword").Value)
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
关于sql-server-2005 - 在 SSIS 中使用表达式的 FTP 连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3888170/