General information
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only