SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


stored procedure unable to find file on another server


stored procedure unable to find file on another server

Author
Message
Meatloaf
Meatloaf
SSC-Addicted
SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)SSC-Addicted (480 reputation)

Group: General Forum Members
Points: 480 Visits: 421
helo,

i have created an application that needs to find a file on the network and ingest data.

I have been testing by just having test files on the local server, and when my stored procedure is called it processes without any problems.

however, the live files will live on a different server. I can create a mapped drive to the firectory and I can UNC to it as well. But my stored procedure cannot find the file.

In order to be able to process a file on another server, is their specific SQL or Network permissions that need to be set?
jimbobmcgee
jimbobmcgee
SSC Veteran
SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)

Group: General Forum Members
Points: 276 Visits: 916
What OS user is running your SQL Server instance?
What SQL user is running your stored procedure?
How are you accessing the file, when it is on the same server?
What file-transfer protocols are required to access the file on the remote server (SMB, FTP, SFTP)?
Is the other server on the same domain (or a domain with an adequate trust relationship)?

Assuming SMB is your transfer protocol, essentially, the other server has to accept fileshare connections from the user that is running the SQL Server processes.

If the two servers are on the same domain and the SQL Server instance is running under an account which supplies a network credential (i.e. NETWORK SERVICE or a domain account; note that machine-local accounts and SYSTEM do not), then you may be able to permit that account to access the remote file share.

You will also have to specify UNC paths, rather than a mapped drive letter, as the drive letter is transient, while the UNC path should be fixed.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: Administrators
Points: 150688 Visits: 19455
Jim has given you good advice.

Note that when you run something, it isn't your account that runs it. It is the service account for SQL Server, not the user connected. Therefore the path needs to be valid for the service account, along with the proper security.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search