Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Question
Message
De
24/07/2002 15:33:25
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Query Question
Divers
Thread ID:
00682240
Message ID:
00682240
Vues:
62
Hi All,

Is it possible to query a table that will return more than one row into a defined variable?

Example:
SET @strContent = ( SELECT content FROM cache WHERE id = @random )

I have tried this and I get the following error:
[Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.]

I built a simply query to get the results into a cursor and do a string concatenation while iterating the cursor to build the single variable I am looking for, but SQL Server seems to be very slow with string manipulation.

Any ideas???

Thnaks in advance...
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform