ALTER procedure [dbo].[Usp_ProfessionalEmails_ProjectActivated]
(
@pid bigint
) -- Usp_ProfessionalEmails_ProjectActivated '21'
AS
declare @ptitle varchar(500)
set @ptitle=(select tbl_Project.ProjectTitle from tbl_Project where tbl_Project.ID=@pid)
declare @listername varchar(100)
set @listername=(select tbl_User.UserName from tbl_User inner join tbl_Project on tbl_User.UserID=tbl_Project.UserID and tbl_Project.ID=@pid )
select @ptitle as ProjectTitle,@listername as ListerName
select tbl_Contractor.ID,tbl_User.UserName,tbl_User.Email from tbl_Contractor inner join tbl_User on tbl_Contractor.UserID=tbl_User.UserID
where exists
(
select entry from dbo.ListToTable
(
(select tbl_Project.CategoryID from tbl_Project where tbl_Project.ID=@pid)
)
where entry in (select e.entry from ListToTable(ProjectCategoriesAlert) e)
)
(
@pid bigint
) -- Usp_ProfessionalEmails_ProjectActivated '21'
AS
declare @ptitle varchar(500)
set @ptitle=(select tbl_Project.ProjectTitle from tbl_Project where tbl_Project.ID=@pid)
declare @listername varchar(100)
set @listername=(select tbl_User.UserName from tbl_User inner join tbl_Project on tbl_User.UserID=tbl_Project.UserID and tbl_Project.ID=@pid )
select @ptitle as ProjectTitle,@listername as ListerName
select tbl_Contractor.ID,tbl_User.UserName,tbl_User.Email from tbl_Contractor inner join tbl_User on tbl_Contractor.UserID=tbl_User.UserID
where exists
(
select entry from dbo.ListToTable
(
(select tbl_Project.CategoryID from tbl_Project where tbl_Project.ID=@pid)
)
where entry in (select e.entry from ListToTable(ProjectCategoriesAlert) e)
)
0 comments:
Post a Comment