Use '=' or LIKE to compare strings in SQL?

o see the performance difference, try this:
SELECT count(*)
FROM master..sysobjects as A
JOIN tempdb..sysobjects as B
on A.name = B.name

SELECT count(*)
FROM master..sysobjects as A
JOIN tempdb..sysobjects as B
on A.name LIKE B.name
Comparing strings with '=' is much faster.

Comments

Popular posts from this blog

How can I debug PHP cURL sessions?

Free icons

Where is the security section of google analytics? “Security Issues” section.