How to get

  • DECLARE @Input Varchar(20)

    SET @Input='Parthi'

    Select @Input

    I need O/P like:'Parthi's'

    How to Get "Parthi's"

    If i want to insert into a table, how to insert it

    after inserting into table how to get in the select statement

    Thanks
    Parthi

  • DECLARE @Input Varchar(20)

    SET @Input = 'Parthi'

    SET @Input = @Input + '''s'

    Select @Input

    Escape a quote by doubling it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi Gail thanks

    how to get this

    Select 'Hi I 'll be there @6'O clock '

    Thanks
    Parthi

  • As I said, escape a quote by doubling it. So if you want single quotes within a string, put two of them to make a single ' character.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • As mentioned by Gail above:

    DECLARE @Input Varchar(40)

    SET @Input='Hi I ''ll be there @6''O clock'

    Select @Input

Viewing 5 posts - 1 through 4 (of 4 total)

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