Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2008-05-28 : 12:26:09
|
| Hi When I try and create this procedure, I get the error belowCREATE PROCEDURE GetUserSearchTypesCount-- OUTPUT parameter to hold the count. @UserID int, @ReturnVal int OUTPUT ASSET @ReturnVal = (SELECT TOP 100 percent searchType, COUNT(searchtype) AS SearchCount FROM ttracksearchresults WHERE userid=@UserIDGROUP BY searchtypeORDER BY searchtype)GOError: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 12:32:53
|
| You cant assign a variable with a result set. Why are trying to return the entire resultset through the integer variable?Can i ask what your reqmnt is? |
 |
|
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2008-05-28 : 12:38:16
|
| I'm sorry - I posted this in error and have it working now. Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 12:42:30
|
quote: Originally posted by evanburen I'm sorry - I posted this in error and have it working now. Thanks
No probs. Glad that you sorted it out. |
 |
|
|
|
|
|