Hi, Maybe somebody can help me. I have my Store procedure where I call to AP_BCP_FILE procedure with those parameters EXEC AP_BCP_FILE @file_name = '\\Server\t-import\import\TestData.txt', @format_file = '-c', @table_name = 'lt_hf_custom_data_staging', @db_login = '-T', @bcp_in_out = 'IN' and I get the error message Msg 50000, Level 11, State 2, Procedure AP_BCP_FILE, Line 218\\server\import\TestData.txt is not a valid file or the process isunable to access the file. Any Idea how I can fix it? Thanks Adrian
Hi,
Maybe somebody can help me. I have my Store procedure where I call to AP_BCP_FILE procedure with those parameters
EXEC AP_BCP_FILE @file_name = '\\Server\t-import\import\TestData.txt', @format_file = '-c', @table_name = 'lt_hf_custom_data_staging', @db_login = '-T', @bcp_in_out = 'IN'
and I get the error message
Msg 50000, Level 11, State 2, Procedure AP_BCP_FILE, Line 218\\server\import\TestData.txt is not a valid file or the process isunable to access the file.
Any Idea how I can fix it?
Thanks
Adrian
The user you are running SQL service as - has to have access to \\server\t_import folder. If you are running SQL as a local user or system account, this won't work (someone can mention proxy accounts here). If you run SQL as a domain user, you can add this domain user to be allowed to access the share (windows security is stopping you)
A more simple approach could be to create a hidden share on the SQL server (c:\mysharedfolder\) and drop the import file on there, then your @file_name would be c:\mysharedfolder\testdata.txt.
For simplicitys sake (tighten back up later) set the folder security to "Everyone" group.
Try this and see how you get on.