Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return into Array
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01329359
Message ID:
01329372
Views:
12
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform