2

I want to know if it is possible to import a file's contents without knowing the exact file location/path. Instead of the file path, the file contents will directly be passed in as a string, to say a stored procedure.

How can I utilize any of the insert options like BULK INSERT or OPENROWSET etc. to import/copy data directly from input as string (instead of giving file path), and please do give some examples or links, with code if possible.

If more details are needed, I can provide. Or, do I have to perform string manipulation with looping of some kind to input the huge string file blob into respective tables/columns?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Loser Coder
  • 2,338
  • 8
  • 42
  • 66
  • Passed as a string to what? if a usp why not pass inserts & exec, or given that you can communicate with the server why not regular client side inserts – Alex K. May 18 '11 at 14:53
  • I have edited my question a little bit – Loser Coder May 18 '11 at 16:07
  • Never mind, I am using a different approach for this now. It's not possible to use any of the options by parsing the input in, we would need the file location to use the bulk insert or openrowset etc. – Loser Coder May 18 '11 at 17:28
  • Maybe this will help you: [http://stackoverflow.com/questions/7306616/bulk-insert-with-filename-parameter/7306741#7306741](http://stackoverflow.com/questions/7306616/bulk-insert-with-filename-parameter/7306741#7306741) – Bogdan Sahlean Sep 20 '11 at 09:58

0 Answers0