I have a query like this:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[User_SelectByLoginID]
@LoginID nvarChar(4)
as
SELECT dbo.[User].*
FROM dbo.[User]
WHERE LoginID=@LoginID
And data in the User table:
LoginID ='1111' | Name ='abc' | Email = 'abc@yahoo.com'
when I executed this query and typed in '1111111', it returned the record:
1111 abc abc@yahoo.com
it is ridiculous when I entered the wrong LoginID and still got the data.
P/S: I set LoginID nvarchar(4)
Can someone explain for me? And how to make it right?