Supplying stream as a source of data for a binary column when SqlBulkCopy is used
问题 If one needs to read data from SqlServer in a streamed fashion, there are some capabilities for that. Such as using SqlDataReader with CommandBehavior.SequentialAccess , and particularly when binary column data needs to be accessed there is the GetStream(int) method for that: var cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandText = @"select 0x0123456789 as Data"; using (var dr = cmd.ExecuteReader(CommandBehavior.SequentialAccess)) { dr.Read(); var stream = dr.GetStream(0); /