Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return into Array
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01329359
Message ID:
01329372
Vues:
13
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform