Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: T-SQL

    it is because in the sample the delimiter became now comma and space.

    both possibilities will work:

    SET @inputValue = 'Hardy, Rocky, ardy'

    SELECT * FROM @student WHERE CHARINDEX(', '+StudentName+',', ', '+@inputValue+',') >...

  • RE: T-SQL

    How about adding delimiters? Avoiding ardy and ocky.

    DECLARE @inputValue NVARCHAR(20)

    DECLARE @student TABLE

    (Id INT PRIMARY KEY IDENTITY(1,1),

    StudentName NVARCHAR(50),

    StudentResult INT)

    INSERT INTO @student

    VALUES( 'Hardy', 100), ('Rocky', 98), ('Panky', 99), ('ardy', 97), ('ocky', 96)

    --Select...

Viewing 2 posts - 1 through 2 (of 2 total)