有 ia 表,这是此电子邮件中的用户表,我想选择电子邮件,然后另一个表是文档信息表,在此表中我选择文档名称、上传文件、上传者,另一个表是批准类型在此表中我选择批准键入并且当用户上传文档信息进入文档信息表但我想选择电子邮件以通过相应的 emailid 发送邮件我尝试选择但我不能..这里是 sp
ALTER procedure [dbo].[email]
@DepID int
as
SELECT
dbo.DocumentInfo.DocName as DocumentName,
dbo.DocumentInfo.Uploadfile as FileUploaded,
dbo.Department.DepType as Department,
dbo.DocumentInfo.UploadedBy as UploadedBy,
dbo.ApproveType.ApproveType as Status
FROM dbo.DocumentInfo INNER JOIN
dbo.Approval ON dbo.DocumentInfo.DocID = dbo.Approval.DocID INNER
JOIN
dbo.ApproveType ON dbo.Approval.ApproveID =
dbo.ApproveType.ApproveID INNER JOIN
dbo.Userss on Userss.UserID =dbo.Userss.UserID inner join
dbo.Department ON dbo.DocumentInfo.DepID = dbo.Department.DepID
INNER JOIN
dbo.DocType ON dbo.DocumentInfo.DocTypeID = dbo.DocType.DocTypeID
where DocumentInfo.DepID=@DepID
这是用户表
UserID UserName Password UserTypeID Email DesgId
1 kety cute 2 acv@ymail.com 4
2 John bravo 2 john@gmail.com 4
这是文档信息表
**DocId DocName Uploadedfile DocTypeID DepID ApproveID UploadedBy UserID**
18 hranaylsis HR.docx 1 2 2 john 6
19 ecoreport eco 2.docx 1 2 1 john 6
现在我如何在 sp 中选择电子邮件