Created
August 5, 2011 11:51
-
-
Save spockz/1127373 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [UUSurvey] | |
| GO | |
| DECLARE @return_value int | |
| EXEC @return_value = [dbo].[Search_AlleCursussenActief_Opleiding] | |
| @Q = N'INFO' | |
| SELECT 'Return Value' = @return_value | |
| GO | |
| -- This still contains rows with CourseName = 'WIS...' not good! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE PROCEDURE Search_AlleCursussenActief_Opleiding (@Q nvarchar) | |
| AS | |
| BEGIN | |
| SET NOCOUNT ON; | |
| SELECT DISTINCT c.*, opl.OPLEIDING AS Programme, opl.NaamEn AS ProgrammeNameEN, opl.NaamNL AS ProgrammeNameNL, opl.TypeOpleiding AS [Type] | |
| FROM [dbo].Cursussen AS c, [dbo].Opleidingen_Cursussen AS opl | |
| WHERE | |
| c.StartDate <= CURRENT_TIMESTAMP AND c.EndDate >= CURRENT_TIMESTAMP AND | |
| c.CourseName = opl.CURSUS AND opl.Faculteit = c.Faculty AND | |
| c.CourseName LIKE '%' + @Q + '%' | |
| ORDER BY c.CourseName | |
| END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DISTINCT c.*, opl.OPLEIDING AS Programme, opl.NaamEn AS ProgrammeNameEN, opl.NaamNL AS ProgrammeNameNL, opl.TypeOpleiding AS [Type] | |
| FROM [dbo].Cursussen AS c, [dbo].Opleidingen_Cursussen AS opl | |
| WHERE | |
| c.StartDate <= CURRENT_TIMESTAMP AND c.EndDate >= CURRENT_TIMESTAMP AND | |
| c.CourseName = opl.CURSUS AND opl.Faculteit = c.Faculty AND | |
| c.CourseName LIKE '%INFO%' | |
| ORDER BY c.CourseName | |
| -- This gives the correct result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment