I have SQL code that is executing slow
DECLARE @ccode varchar(500) SET @ccode = '%NIP%'
SELECT [CVN_UID] FROM [Klasje].[dbo].[VERSION_CATEGORY_XREFS] WHERE DESCRIPTOR_TEXT LIKE @ccode
Why sql server uses Nested loops?
This code is working fine, it uses only index scan: SELECT [CVN_UID] FROM [Klasje].[dbo].[VERSION_CATEGORY_XREFS] WHERE DESCRIPTOR_TEXT LIKE '%NIP%'
Thank you!