Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved Database
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Niladri_Biswas
    wrote on last edited by
    #1

    [Message Deleted]

    M 1 Reply Last reply
    0
    • N Niladri_Biswas

      [Message Deleted]

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      You can nest the character replacements. It works by pattern matching so you can only use 1 character at a time. I have not tested with variable for keyword and replacechars but this works

      Declare
      @Var VARCHAR(100)

      SET @Var = 'QWERTYUIOP'

      --Replace(@Var, 'Q', 'X') Use this to replace @Var when nesting

      SELECT Replace(Replace(Replace(@Var, 'Y', '_'), 'P', 'X'), 'Q', 'X')

      N 1 Reply Last reply
      0
      • M Mycroft Holmes

        You can nest the character replacements. It works by pattern matching so you can only use 1 character at a time. I have not tested with variable for keyword and replacechars but this works

        Declare
        @Var VARCHAR(100)

        SET @Var = 'QWERTYUIOP'

        --Replace(@Var, 'Q', 'X') Use this to replace @Var when nesting

        SELECT Replace(Replace(Replace(@Var, 'Y', '_'), 'P', 'X'), 'Q', 'X')

        N Offline
        N Offline
        Niladri_Biswas
        wrote on last edited by
        #3

        Thanks for the answer but I made the solution using recursive CTE But a 5 for u always :)

        Niladri Biswas

        L 1 Reply Last reply
        0
        • N Niladri_Biswas

          Thanks for the answer but I made the solution using recursive CTE But a 5 for u always :)

          Niladri Biswas

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          please don't delete messages, we now have an answer without the question it belongs to. :mad:

          Luc Pattyn [Forum Guidelines] [My Articles]


          I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


          D 1 Reply Last reply
          0
          • L Luc Pattyn

            please don't delete messages, we now have an answer without the question it belongs to. :mad:

            Luc Pattyn [Forum Guidelines] [My Articles]


            I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


            D Offline
            D Offline
            David Skelly
            wrote on last edited by
            #5

            Sounds like fun. A sort of Code Project Jeopardy.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups