In the code below, I get two records as checked by @@rowcount . From the if statement below, I don't expect the message 'sorry, ... is not in the tblCustomer' to be printed but it does?
Question: What is wrong with this if statement?
DECLARE @ta table (
, FirstName varchar(30)
, LastName varchar(30))
INSERT INTO @ta SELECT
WHERE FirstName = 'Mike'
print @@rowcount -- this prints 2
IF @@rowcount =0
PRINT 'sorry, ... is not in the tblCustomer.' - this line shouldn't print but it does, why?