-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: laks_win
Message 5 in Discussion
Hi,
sorry Mr.Babu...for not giving the correct post/reply Url.
The solution is here. Yes, it comes with the following steps.
1. Create a Function to combine the projects for the corresponding EmpId. Bcz
combining comes in a single variable. Cannot display as column in a query.
2. Call that function as a column
[Query]
-- Procedure for combining the projects
CREATE FUNCTION ProjectsList (@EmpId int)
RETURNS varchar(1000) AS
BEGIN
DECLARE @projects varchar(1000)
SELECT @projects = COALESCE(@projects + ',','') +
EmpProjects.Project FROM Employee INNER JOIN EmpProjects ON
Employee.EmpId = EmpProjects.EmpId
WHERE EmpProjects.empId = @EmpId
RETURN @projects
END
-- Call the Function ProjectsList
SELECT EmpId, dbo.ProjectsList(EmpId) FROM Employee
[/Query]
Hope this helps.
Regards
Lakshmi Narayanan.R
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]