Assuming [Common]
is your database schema and [AspNetUsers]
is the table automatically created using membership services (or by some other means), I'm unsure what [tbl_Interpreter_Account]
refers to. Could you please clarify?
Also the join needs to be corrected.
You're joining what appears to be the following two tables: AspNetUsers
and AddIntrepeter
. But the join condition is on some other table Interpreter_Account
Try the following:
Insert your databasename at the top of the procedure.
USE [Common]
CREATE PROCEDURE [dbo].[GetIntIdByEmail]
@email nvarchar(50)
AS
SELECT
AspNetUsers.UserName
FROM [AspNetUsers] users
INNER JOIN [<<Your_Table>>] interpreter ON users.Id = interpreter.<<your_Matching_Column>>
WHERE interpreter.contact_email = @email
GO