I have this stored procedure that doesn't return the record i want and that record exists:
ALTER PROCEDURE [dbo].[Student_SearchByName]
@FName NVarchar
AS
BEGIN
SELECT
StudentID, FName, LName, Student.BirthDate,
DATEDIFF(hour, BirthDate, GETDATE()) / 8766 As 'Age'
FROM
Student
WHERE
Student.FName = @FName
END
I fill the parameter in Visual Studio and also tried:
SELECT
StudentID, FName, LName, Student.BirthDate,
DATEDIFF(hour, BirthDate, GETDATE()) / 8766 As 'Age'
FROM
Student
WHERE
Student.FName = 'Name'
and it worked, but when I use the parameter I get no result!