Reputation: 3105
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?
Upvotes: 2
Views: 461
Reputation: 1062600
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.
Upvotes: 3