Information générale
Forum:
Microsoft SQL Server
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement