2

I have a text stream that I can save as a txt file and then call sql server stored proc to bulkinsert that txt file.

But I don't want to deal with file system access and all that stuff. and sqlBulkCopy can't do it I beleive. What's the solution then?

1 Answer 1

3

If the incoming stream represents rows for a table, then you can write a custom IDataReader implementation that reads from the stream and presents each row in turn (non-buffered). You can then feed this to SqlBulkCopy.

Example: https://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/b1d70b504cdee2ad?hl=en&pli=1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.