visual-studio SSIS 包中的平面文件连接管理器显示“必须选择有效的文件名”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2371988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Flat File Connection Manager in SSIS package shows "Valid File Name Must be Selected"
提问by Feckmore
(Flat File Location)
Samba Share | Windows Share
(SSIS) _______________________________
| |
XP 32bit | Works | Works
| |
2003 Serv 32bit | Works | Works
| |
Vista 64bit | ERROR | Works
| |
Win 7 64bit | ERROR | Works
| |
2008 Serv 64bit | ERROR | Works
I created an SSIS package in VS 2008 that parses a flat file from a shared folder and puts the records into a SQL Server db.
我在 VS 2008 中创建了一个 SSIS 包,它从共享文件夹解析平面文件并将记录放入 SQL Server 数据库。
I recently installed Windows 7 and VS 2008 on a new workstation. When I import the package from TFS and open it, I get the error
我最近在新工作站上安装了 Windows 7 和 VS 2008。当我从 TFS 导入包并打开它时,出现错误
Validation error. Parse and Import Catalog Flat File: MySSISPackage: The file name "\\shared\flatfile.txt" specified in the connection was not valid.
验证错误。解析并导入目录平面文件:MySSISPackage:连接中指定的文件名“\\shared\flatfile.txt”无效。
When I open the Flat File Connection Manager Editor, there is an error stating:
当我打开平面文件连接管理器编辑器时,出现错误说明:
A valid file name must be selected
必须选择有效的文件名
I can browse to and select the file from inside the editor, but I cannot change any properties, or move away from the General tab because of this error.
我可以从编辑器内部浏览并选择文件,但由于此错误,我无法更改任何属性,也无法离开“常规”选项卡。
If I go back to my laptop (Windows XP), where the package was first created, there is no error. Both workstations are on the same domain, and I'm logging in using the same credentials.
如果我回到我的笔记本电脑 (Windows XP),在那里首先创建包,没有错误。两个工作站都在同一个域中,我使用相同的凭据登录。
Any ideas as to why I would receive this error from one workstation and not another?
关于为什么我会从一个工作站而不是另一个工作站收到此错误的任何想法?
UPDATE: If I take the .dtsx package from the running workstation and load it into SSIS on the server, I get the following errors when it tries to run:
更新:如果我从正在运行的工作站获取 .dtsx 包并将其加载到服务器上的 SSIS 中,当它尝试运行时,我会收到以下错误:
Error: The file name "\\shared\flatfile.txt" specified in the connection was not valid.
错误:连接中指定的文件名“\\shared\flatfile.txt”无效。
and...
和...
Error: Connection "MySSISPackage" failed validation.
错误:连接“MySSISPackage”验证失败。
and...
和...
Error: The file name property is not valid. The file name is a device or contains invalid characters.
错误:文件名属性无效。文件名是设备或包含无效字符。
UPDATE 2:
更新 2:
a) The Shared folder I'm trying to pull the flat file from is a Samba share on a Unix box.
a) 我试图从中提取平面文件的共享文件夹是 Unix 机器上的 Samba 共享。
b) If I access the file using SSIS on any 64-bit platform (Windows 7 64-bit, Vista 64-bit, Windows Server 2008) I get the error "A valid file name must be selected."
b) 如果我在任何 64 位平台(Windows 7 64 位、Vista 64 位、Windows Server 2008)上使用 SSIS 访问文件,我会收到错误“必须选择有效的文件名”。
c) Accessing the file using SSIS from 32-bit environments (Windows XP 32-bit, Windows Server 2003 32-bit) there is no problem.
c) 从 32 位环境(Windows XP 32 位、Windows Server 2003 32 位)使用 SSIS 访问文件没有问题。
d) If I move the file to a shared folder on a Windows server, 64-bit SSIS recognizes the file.
d) 如果我将文件移动到 Windows 服务器上的共享文件夹,64 位 SSIS 会识别该文件。
采纳答案by Michael
I had a similar problem. What I did was in Solution Explorer I right-clicked on the project name and selected properties. I then clicked Debugging and the set the Run64BitRuntime property = 'False'. The Excel file is 32 bit so running SSIS as a 64 bit application won't work in this scenario.
我有一个类似的问题。我所做的是在解决方案资源管理器中右键单击项目名称和选定的属性。然后我单击调试并设置 Run64BitRuntime 属性 = 'False'。Excel 文件是 32 位的,因此在这种情况下将 SSIS 作为 64 位应用程序运行将不起作用。
回答by Yves Deschenes
We had the same kind of problem. After searching a while, we found that the account used had access to the sub-dir, but not to the share. It looks like your account needs to have access inherited from then highest directory.
我们遇到了同样的问题。经过一段时间的搜索,我们发现使用的帐户可以访问子目录,但不能访问共享。看起来您的帐户需要从最高目录继承访问权限。
e.g.: \\server\share\foder\subfold1\subfold2\file.csv <== We need access here acces to "subfold2" is not inherited and the account did not have access to \\server\share\
例如:\\server\share\foder\subfold1\subfold2\file.csv <== 我们需要在这里访问“subfold2”的访问权限不是继承的,并且该帐户无权访问 \\server\share\
So we gave acces to \\server\share\ and it fixed the problem.
所以我们允许访问 \\server\share\ 并解决了问题。
回答by Alex KeySmith
In BIDS (visual studio SSIS), if you go to the SSIS menu (on the top bar), and uncheck "work offline".
在 BIDS(visual studio SSIS)中,如果您转到 SSIS 菜单(在顶部栏上),并取消选中“脱机工作”。
A right pain in the bum, I got the hint to the fix in http://www.sqldev.org/sql-server-integration-services/flat-file-connection-manager-problem-32774.shtml
一个正确的痛苦,我在http://www.sqldev.org/sql-server-integration-services/flat-file-connection-manager-problem-32774.shtml得到了修复的提示
回答by Ali
I found a solution by just changing the file path to one it could digest better - named drive worked. Example: Text file was on \server\filepath\filename.txt ERROR I copied the file over to c:\filepath\filename.txt and it worked fine.
我找到了一个解决方案,只需将文件路径更改为可以更好地消化的路径 - 命名驱动器工作。示例:文本文件位于 \server\filepath\filename.txt 错误我将文件复制到 c:\filepath\filename.txt 并且它工作正常。
回答by Joshua Pierce
There is one other possibility here, and the solution that worked for me on the same problem was to right click the connection manager, and choose DelayValidation = True instead of the default of false. My pain point was using SSIS Configurations to tell where the file was at and BIDS did not like the network share file path.
这里还有另一种可能性,在同一问题上对我有用的解决方案是右键单击连接管理器,然后选择 DelayValidation = True 而不是默认值 false。我的痛点是使用 SSIS 配置来判断文件所在的位置,而 BIDS 不喜欢网络共享文件路径。
回答by Doctuh D.
I had this problem with a SQL 2008 R2 box running an SSIS package in a job which accessed a Windows 2008 share. Granting access to the share and to the specific folder did not work. I kept getting the error:
我在访问 Windows 2008 共享的作业中运行 SSIS 包的 SQL 2008 R2 机器遇到了这个问题。授予对共享和特定文件夹的访问权限不起作用。我一直收到错误:
The file name property is not valid. The file name is a device or contains invalid characters.
The file name property is not valid. The file name is a device or contains invalid characters.
After spending far too much time troubleshooting, I found that restarting SQL Server agent fixed the issue.
在花费太多时间进行故障排除后,我发现重新启动 SQL Server 代理解决了该问题。
回答by Andy Shellam
Are you loading it into SQL Server on the workstation, or is it a central server?
您是将其加载到工作站上的 SQL Server 中,还是中央服务器?
If on the workstation, does SQL Server run under the same account on both machines? It's possible the SQL Service on the new machine is running under a different account and thus doesn't have access to the file.
如果在工作站上,SQL Server 是否在两台机器上以相同的帐户运行?新机器上的 SQL 服务可能在不同的帐户下运行,因此无权访问该文件。
回答by user359230
This sounds like a problem with connecting to the CIFS share.
这听起来像是连接到 CIFS 共享的问题。
On Windows 7 & Server 2008 there are several settings we had to change to allow the SSIS service account to connect to the CIFS share in our environment. I would try each of these 1 step at a time since there are situations where all steps are not required.
在 Windows 7 和 Server 2008 上,我们必须更改多项设置以允许 SSIS 服务帐户连接到我们环境中的 CIFS 共享。我会一次尝试这 1 个步骤中的每一个,因为有些情况下不需要所有步骤。
Step 1: Administrative Tools -> Local Security Policy -> Security Settings -> Local Policies -> Security Options -> Network Security: LAN Manager Authentication Level Change this value to: Send LM and NTLM -use NTLM2 session security if negotiated
步骤 1:管理工具 -> 本地安全策略 -> 安全设置 -> 本地策略 -> 安全选项 -> 网络安全:LAN 管理器身份验证级别将此值更改为:发送 LM 和 NTLM -如果协商使用 NTLM2 会话安全
Step 2: Disable IP v.6
步骤 2:禁用 IP v.6
Step 3: Force TCP/IP over Netbios.
第 3 步:通过 Netbios 强制使用 TCP/IP。

