Skip to content

Commit

Permalink
removes AS from sql selects since they're no longer needed (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
runeanielsen authored Dec 23, 2021
1 parent 883c265 commit c8a054b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MsSqlCdc/CdcDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static class CdcDatabase
{
public static async Task<bool?> IsBitSet(SqlConnection connection, int position, string updateMask)
{
var sql = "sys.fn_cdc_is_bit_set(@position, @update_mask ) AS is_bit_set";
var sql = "sys.fn_cdc_is_bit_set(@position, @update_mask )";

using var command = new SqlCommand(sql, connection);
command.Parameters.AddWithValue("@position", position);
Expand Down Expand Up @@ -80,15 +80,15 @@ internal static class CdcDatabase

public static async Task<byte[]?> GetMaxLsn(SqlConnection connection)
{
var sql = "SELECT sys.fn_cdc_get_max_lsn() AS max_lsn";
var sql = "SELECT sys.fn_cdc_get_max_lsn()";
using var command = new SqlCommand(sql, connection);

return (byte[]?)(await command.ExecuteScalarAsync());
}

public static async Task<byte[]?> DecrementLsn(SqlConnection connection, long lsn)
{
var sql = "SELECT sys.fn_cdc_decrement_lsn(@lsn) AS previous_lsn";
var sql = "SELECT sys.fn_cdc_decrement_lsn(@lsn)";
using var command = new SqlCommand(sql, connection);
command.Parameters.AddWithValue("@lsn", lsn);

Expand All @@ -97,7 +97,7 @@ internal static class CdcDatabase

public static async Task<byte[]?> IncrementLsn(SqlConnection connection, long lsn)
{
var sql = "SELECT sys.fn_cdc_increment_lsn(@lsn) AS next_lsn";
var sql = "SELECT sys.fn_cdc_increment_lsn(@lsn)";
using var command = new SqlCommand(sql, connection);
command.Parameters.AddWithValue("@lsn", lsn);

Expand Down

0 comments on commit c8a054b

Please sign in to comment.