Unclosed quotation mark after the character string '.jpg’

  • Hi,

    I am serious new to the world of Sql Server so apologize that maybe my question is on newbie level. I am trying to execute following in Sql Server Managment Studio.

    declare @item int

    declare @name varchar(10)

    set @item = 21

    while @item <= 23

    begin

    set @name = cast(@item as varchar(10))

    UPDATE [CosmosVenture].[dbo].[CV_Hotel]

    SET [CV_HotelPhoto] = 'images/hotel/' + @name + '/main/' + @name + '.jpg’

    WHERE [AH_HotelID] = @item

    set @item = @item + 1

    end

    Thanks Andy

    And the error I get is following...

    Msg 105, Level 15, State 1, Line 8

    Unclosed quotation mark after the character string '.jpg’

    WHERE [AH_HotelID] = @item

    set @item = @item + 1

    end

    '.

    Msg 102, Level 15, State 1, Line 8

    Incorrect syntax near '.jpg’

    WHERE [AH_HotelID] = @item

    set @item = @item + 1

    end

    '.

  • I think you have the wrong type of quote at the end of .jpg a " ` " instead of " ' "

    replace the quote and it should be OK

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

You must be logged in to reply to this topic. Login to reply