Skip to content

Commit

Permalink
now uses simple string concat instead of sqlbuilder (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
runeanielsen authored Jan 12, 2022
1 parent de2c5c1 commit ad7afea
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/MsSqlCdc/CdcDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ internal static class CdcDatabase
long endLsn,
string filterOption)
{
var builder = new SqlCommandBuilder();
// We have to do this here, since we cannot pass the function as command parameter.
var function = builder.UnquoteIdentifier($"{cdcFunction}_{captureInstance}");

var sql = $"SELECT * FROM {function}(@begin_lsn, @end_lsn, @filter_option)";
var sql = $"SELECT * FROM {cdcFunction}_{captureInstance}(@begin_lsn, @end_lsn, @filter_option)";

using var command = new SqlCommand(sql, connection);
command.Parameters.AddWithValue("@begin_lsn", beginLsn);
Expand Down

0 comments on commit ad7afea

Please sign in to comment.