code_junkie

MS SQL Server - Bulk Insert Across a Network

Nov 13th, 2011
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. comm.CommandText = @"EXEC spWriteStringToFile @data, 'c:datadumps', 'data.csv';
  2. BULK INSERT my_table FROM 'c:datadumpsdata.csv';";
  3. comm.Parameters.AddWithValue("data", File.ReadAllText(path));
  4. comm.ExecuteNonQuery();
Add Comment
Please, Sign In to add comment