Viacheslav Maliutin


SQLServerCentral Article

Should I Type * or 1 With the EXISTS Logical Operator

In my project I see that people writes different things with EXISTS logical operator (EXISTS (SELECT StarOrOne FROM...)). They are "*", "1" and even "TOP 1 1" or "TOP 1 *". The aim of this article to give a good explanation which option is the best.

4.59 (44)

You rated this post out of 5. Change rating

2020-01-24 (first published: )

14,842 reads

Blogs

Sample Data with GenAI in Seconds

By

A friend was asking for help with some data analysis. This was in PowerBI,...

TSQL Tuesday #188 Growing community

By

I am responding late to a T-SQL Tuesday invite from John Sterrett. John’s call...

Time to Revive our YouTube Channel

By

It’s been forgotten about and neglected for few years but I’ve decided to dust...

Read the latest Blogs

Forums

How a Legacy Logic Choked SQL Server in a 30-Year-Old Factory

By Chandan Shukla

Comments posted to this topic are about the item How a Legacy Logic Choked...

do i lose "what this object depends on" etc when moving sprocs to etl server

By stan

Hi i was surprised to see the approach my coworkers used to sunset talend...

People Make Odd Choices

By Grant Fritchey

Comments posted to this topic are about the item People Make Odd Choices

Visit the forum

Question of the Day

Query Plan Regressions --

For the Question of the day, I am going to go deep, but try to be more clear, as I feel like I didn't give enough info last time, leading folks to guess the wrong answer... :) For today's question:  You’re troubleshooting a performance issue on a critical stored procedure. You notice that a previously efficient query now performs a full table scan instead of an index seek. Upon investigating, you find that an NVARCHAR parameter is being compared to a VARCHAR column in the WHERE clause. What is the most likely cause of the query plan regression?

See possible answers