>Thank You Borislav,
>
>Can I make a Function this line of code that you give me and pass the PK of the value and return that Variable? Inside of a store procedure in SQL Server?
Sure, you could.
Something like:
CREATE PROCEDURE MyTest (@PK int)
AS
SELECT dbo.GiveMeNames(@PK) AS NameList
CREATE FUNCTION GiveMeNames(@pk int)
RETURNS varchar(8000)
AS
DECLARE @namelist as varchar(8000)
SELECT @namelist = ISNULL(@namelist+',', '') FROM YourTable WHERE PK = @PK
RETURN @namelist
NOT TESTED
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.