shragi
asked on
sql to access file in different server
Hi,
I have a test file in server A and my DB server is in server B.
Now I want to write query in SSMS from Server B and that query should access the file from server A and parse it to store the data in DB.
I am not sure how to establish the connection to server B and get that file.
I am trying to write a stored procedure for this.
No I should not copy that file.
So any suggestions how to get that file from server B to DB server A.
Thanks,
I have a test file in server A and my DB server is in server B.
Now I want to write query in SSMS from Server B and that query should access the file from server A and parse it to store the data in DB.
I am not sure how to establish the connection to server B and get that file.
I am trying to write a stored procedure for this.
No I should not copy that file.
So any suggestions how to get that file from server B to DB server A.
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Again, I just want to say, I know its not clean.. but it should work given limited options.
ASKER
does this command removes the file from original server B
you can add a delete command to be run later. say 10am, or just set the commands to constantly overwrite the file names.
your call..
it just depends on how you want to do this.
your call..
it just depends on how you want to do this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If the idea it's to import data from a file to a table SSMS already provide this functionality.
Just right-click over the database name, choose Tasks / Import data... and follow the wizard.
Just right-click over the database name, choose Tasks / Import data... and follow the wizard.