Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Question
Message
From
24/07/2002 15:33:25
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Query Question
Miscellaneous
Thread ID:
00682240
Message ID:
00682240
Views:
63
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
Map
View

Click here to load this message in the networking platform