sqlHere.com beta

Step 1. Paste query in textarea and click Refactor button

Step 2. get your Refactored query and HTML code

  • Replace [new line]
    with
  • 1.Output type:

  • 2.Output type2





  • 3.Colour

  • 4.Optimized for

  • 5.Comma style
  • 6.Keywords style: from,where,order by etc.
  • 7.Comments
  • Last Snippets shared by members.
  • Select | Show in new window | [2008-04-09 by MK]
    Replace char at position
    DECLARE @test INT
    SET @test= 3 --char number from left in string to replace

    DECLARE @newValue AS CHAR(1)
    SET @newValue = 'X' --new value for replaced text

    DECLARE @inputText AS VARCHAR(10)
    SET @inputText = 'ababababab'

    SELECT CAST(SUBSTRING(@inputText,0,@test) AS VARCHAR) +
    @newValue + CAST(SUBSTRING(@inputText,@test+1,LEN(@inputText) - @test) AS VARCHAR)

    --RESULT 'abXbababab'
©2007-2008 Marcin Kotynia contact & feedback, report bug | About Page generation Time:0