Thanks for taking the time to help. I have an xml file on a server that I'm trying to read from using SQL Server. However, to use bulk loading, I would have to add the account used for the procedure to the bulkadmin server role. I would like to avoid giving such a permission to an account for a single procedure.
Is there another way to read from an xml file without using the bulk load method? I can't copy the xml file directly into the stored procedure (as the file is subject to change).
As far as I know there is no native / built in alternative to load a file into your database. These suggestions come into my mind:
You might use some small piece of application in any language you like.(VB(A), C#, Java, ... all of them can handle files and deal with database connections...)
It should be easy to add a .Net
assembly to your database and call a CLR method. Find details here: http://sqlmag.com/t-sql/file-operations-made-easy
You might define an own user just for this one method, assign the needed rigths, and call it with EXECUTE AS
(read details here: https://msdn.microsoft.com/en-us/library/ms188354.aspx)