Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LIKE - what's wrong
Message
De
28/04/2003 12:16:56
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
LIKE - what's wrong
Divers
Thread ID:
00782298
Message ID:
00782298
Vues:
40
Hello All,
I have been in the BOL and the following should work according to all that I have read, however, sample #1 does not work and sample #2 does work, any idea why? Also, they do not have full-text indexing so I can't use CONTAINS. TIA.

Sample #1
DECLARE @EvaluationID int, @SearchString char(100)

SET @EvaluationID = 23
SET @SearchString = '%quest%'

SELECT DISTINCT( q.QuestionID ), 
	 q.QuestionText, 
	 d.html_description as AnswerDisplay
FROM Questions q 
INNER JOIN Types t ON q.QuestionTypeID = t.TypeID
		INNER JOIN DataGridCode d ON t.TypeID = d.TypeID
	WHERE q.QuestionText LIKE @SearchString
ORDER BY q.QuestionID
Sample #2
DECLARE @EvaluationID int, @SearchString char(100)
SET @EvaluationID = 23

SELECT DISTINCT( q.QuestionID ), 
	 q.QuestionText, 
	 d.html_description as AnswerDisplay
FROM Questions q 
	INNER JOIN Types t ON q.QuestionTypeID = t.TypeID
	INNER JOIN DataGridCode d ON t.TypeID = d.TypeID
WHERE q.QuestionText LIKE '%quest%'
ORDER BY q.QuestionID
Thank you,
Rhonda
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform