/Rhino.Etl.Tests/LoadTest/BatchUpdateUserNames.cs

http://github.com/ayende/rhino-etl · C# · 26 lines · 19 code · 2 blank · 5 comment · 0 complexity · 926342f7d932ac0d5519524200383075 MD5 · raw file

  1. namespace Rhino.Etl.Tests.LoadTest
  2. {
  3. using System.Data.SqlClient;
  4. using Core;
  5. using Rhino.Etl.Core.Operations;
  6. public class BatchUpdateUserNames : SqlBatchOperation
  7. {
  8. public BatchUpdateUserNames()
  9. : base("test")
  10. {
  11. }
  12. /// <summary>
  13. /// Prepares the command from the given row
  14. /// </summary>
  15. /// <param name="row">The row.</param>
  16. /// <param name="command">The command.</param>
  17. protected override void PrepareCommand(Row row, SqlCommand command)
  18. {
  19. command.CommandText = "UPDATE Users SET Name = @Name, TestMsg = 'UpperCased' WHERE Id = @Id";
  20. command.Parameters.AddWithValue("@Name", row["Name"]);
  21. command.Parameters.AddWithValue("@Id", row["Id"]);
  22. }
  23. }
  24. }