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 |
|
davidshq
Posting Yak Master
119 Posts |
Posted - 2005-10-01 : 17:26:55
|
| Any ideas why the following code is returning no results?ALTER PROCEDURE dbo.AllGames ( @varUserName varchar(200), @varSearchQ varchar(10), @varSearchTerm varchar(500) )AS If @varSearchQ = 'false' BEGIN select uID, gID, LastPlayedDate into #templastplayed from LastPlayed where uID LIKE @varUserName select uID as uID2, gID as gID2, Popularity as Popularity2 into #temppopularity from GamePopularity where uID LIKE @varUserName select * from Game G LEFT JOIN #templastplayed LP ON G.ID=LP.gID LEFT JOIN #temppopularity GP ON G.ID=GP.gID2 ORDER BY G.Type END Else select * from Game G WHERE G.Title LIKE @varSearchTerm OR G.Description LIKE @varSearchTerm /* SET NOCOUNT ON */ RETURNDavid- http://www.civilwarsearch.com/- http://www.thehungersite.com/- http://www.grid.org/ |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-10-01 : 17:28:51
|
| Uhhh, no!!!!????MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-10-01 : 17:49:19
|
| Ask the debugging officer.LIKE 'x'is vastly different fromLIKE '%x%'but i guess you got that covered. |
 |
|
|
davidshq
Posting Yak Master
119 Posts |
Posted - 2005-10-01 : 17:57:39
|
| Well, here is an interesting twist to throw in. I addedset @varSearchQ = 'false' right before If @varSearchQ='false' and I am still getting no result set. :-P Before I added the If..Else statement it returned many results...David.- http://www.civilwarsearch.com/- http://www.thehungersite.com/- http://www.grid.org/ |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-10-01 : 18:05:31
|
| I'm sure there is a logical explanation... |
 |
|
|
davidshq
Posting Yak Master
119 Posts |
|
|
|
|
|