I am new in T-SQL. As far as I know, SELECT * is considered to be a bad practice so I always avoid using SELECT * in my code.
However, my colleague told me that use SELECT * is fine for doing an existence check. For example,
IF EXISTS (SELECT * FROM tb_test WHERE ResourceType = 2)
BEGIN
--do something
END
"Because the MSSQL Server knows that the statement is doing an existence check, the optimizer will do the right thing." he said.
Is there no performance overhead when I use SELECT * for doing an existence check??
Thanks in advance.