I need to return the idCity. If it does not find in one table, it is mandatory in the other. Return is null.
My Query
public const string sql = @"DECLARE @retorno AS INT = 0;
SELECT @retorno = id
FROM tabCidade1
WHERE nomeCidade = 'Curitiba'
SELECT @retorno = id
FROM tabCidade2
WHERE nomeCidade = 'Curitiba'
SELECT @retorno;";
Code in C #
using (var connection = My.ConnectionFactory())
{
connection.Open();
int idCidade = connection.Query<int>(sql);
}