Select * from People where LastName = ?cLastName and FirstName = ?cFirstNameRemote View:
Select * from People where LastName Like ?cLastName+'%' and FirstName Like ?cFirstName+'%'The intent was to provide search capability with only partial names, while not hard-coding percent signs (%) for remote views. To see everyone whose last name started with "S", I would simply set the cLastName variable to 'S'. To my recollection, this used to work as expected on both local and remote views. Now, if I set cFirstName to an empty value (''), the remote view only returns records with an empty FirstName field. If I set cFirstName to '%', then it does work as expected, but as I said earlier, I'm trying to avoid doing that in code. Evidently, SQL Server sees FirstName=''+'%' differently than FirstName='%'. Is there a SQL Server setting somewhere that would affect this? I would probably just use the LIKE keyword in the Local View and put the '%' in code, but our framework is expecting the view to be in the format above.