I would like to create a user defined function / store procedure or another SQL mechanism that when passed a filename will read the file contents into a variable for later processing. The mechanism must work within a transaction.
My plan was to use a user defined function however the OPENROWSET function doesn't allow me to pass a variable in as the filename so I need to execute it within a "sp_executesql" statement and the function become non-deterministic.
Are the any workarounds I can user to get around non-deterministic function?