Re: Row filtering - Comparing HOST_NAME() with uniqueidentifier

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi again Hilary,

My "final" where clause would be as follows:

SELECT <columnas_publicadas> FROM [dbo].[Appointment] WHERE
HOST_NAME() = convert(nvarchar(100), patientId) or HOST_NAME()
= convert(nvarchar(100), doctorId) and isClosed = 0

You can notice that I am now able to do the comparison between
uniqueidentifier and nvarchar. I thougth this comparison had to be done
in the other direction, but found this and worked. Would be better to
convert host_name() to uniqueidentifier or left it this way?

I've also noticed that this where clause consumes additional time. I
didn't expect, but this way the first replication delays in some
seconds respect an initial replication wihout where clauses. Is this
normal? Could be because I now haven't got many rows while this
attempts are being done?

Give me some feedback please. Regards.

.