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. Other Discussions
  3. The Weird and The Wonderful
  4. Replace what? [modified]

Replace what? [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasequestion
13 Posts 7 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.
  • B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #1

    REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


    Last modified: 4hrs 41mins after originally posted --

    Pits fall into Chuck Norris.

    P A C E S 5 Replies Last reply
    0
    • B Brady Kelly

      REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


      Last modified: 4hrs 41mins after originally posted --

      Pits fall into Chuck Norris.

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      In what language? :confused:

      B 1 Reply Last reply
      0
      • P PIEBALDconsult

        In what language? :confused:

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #3

        Sorry, T-SQL.  Fixed now.

        Pits fall into Chuck Norris.

        1 Reply Last reply
        0
        • B Brady Kelly

          REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


          Last modified: 4hrs 41mins after originally posted --

          Pits fall into Chuck Norris.

          A Offline
          A Offline
          A Wong
          wrote on last edited by
          #4

          Bah, small fries. I've seen: Something = ISNULL(somecolumn, NULL)

          1 Reply Last reply
          0
          • B Brady Kelly

            REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


            Last modified: 4hrs 41mins after originally posted --

            Pits fall into Chuck Norris.

            C Offline
            C Offline
            Chris Meech
            wrote on last edited by
            #5

            What if the newline was also followed by a carriage return. Would you end up with a sequence of space, carriage return? That's pretty bizarre. :)

            Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

            B 1 Reply Last reply
            0
            • C Chris Meech

              What if the newline was also followed by a carriage return. Would you end up with a sequence of space, carriage return? That's pretty bizarre. :)

              Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

              B Offline
              B Offline
              Brady Kelly
              wrote on last edited by
              #6

              It's replacing a 'literal' new line, so it would replace the CRLF combo with a space.  The horror is not explicitly saying, DON'T REMOVE THIS LINE BREAK!

              Pits fall into Chuck Norris.

              L P 2 Replies Last reply
              0
              • B Brady Kelly

                It's replacing a 'literal' new line, so it would replace the CRLF combo with a space.  The horror is not explicitly saying, DON'T REMOVE THIS LINE BREAK!

                Pits fall into Chuck Norris.

                L Offline
                L Offline
                leppie
                wrote on last edited by
                #7

                \n would have been better here :)

                xacc.ide - now with TabsToSpaces support
                IronScheme - 1.0 alpha 3 out now

                1 Reply Last reply
                0
                • B Brady Kelly

                  It's replacing a 'literal' new line, so it would replace the CRLF combo with a space.  The horror is not explicitly saying, DON'T REMOVE THIS LINE BREAK!

                  Pits fall into Chuck Norris.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  Then the replace should happen before the data hits the database.

                  B 1 Reply Last reply
                  0
                  • B Brady Kelly

                    REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


                    Last modified: 4hrs 41mins after originally posted --

                    Pits fall into Chuck Norris.

                    E Offline
                    E Offline
                    elektrowolf
                    wrote on last edited by
                    #9

                    Uah looks terrible. :~

                    1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Then the replace should happen before the data hits the database.

                      B Offline
                      B Offline
                      Brady Kelly
                      wrote on last edited by
                      #10

                      Technically, it is.  The query is to extract data destined for a target database that doesn't like newlines.  It's an edge case, as other target databases are happy with the newlines.

                      Pits fall into Chuck Norris.

                      1 Reply Last reply
                      0
                      • B Brady Kelly

                        REPLACE(dvel.Notes, ' ', ' ') T-SQL: Replaces newline with space.


                        Last modified: 4hrs 41mins after originally posted --

                        Pits fall into Chuck Norris.

                        S Offline
                        S Offline
                        Spacix One
                        wrote on last edited by
                        #11

                        I don't see it, obviously the guy who wrote that used XVI32 and doesn't see anything wrong with it...


                        -Spacix All your skynet questions[^] belong to solved

                        B 1 Reply Last reply
                        0
                        • S Spacix One

                          I don't see it, obviously the guy who wrote that used XVI32 and doesn't see anything wrong with it...


                          -Spacix All your skynet questions[^] belong to solved

                          B Offline
                          B Offline
                          Brady Kelly
                          wrote on last edited by
                          #12

                          Spacix One wrote:

                          doesn't see anything wrong with it...

                          That's the horror.  What don't you see?  The ambiguity between a line wrap and a line break in a SQL statement?

                          Pits fall into Chuck Norris.

                          S 1 Reply Last reply
                          0
                          • B Brady Kelly

                            Spacix One wrote:

                            doesn't see anything wrong with it...

                            That's the horror.  What don't you see?  The ambiguity between a line wrap and a line break in a SQL statement?

                            Pits fall into Chuck Norris.

                            S Offline
                            S Offline
                            Spacix One
                            wrote on last edited by
                            #13

                            Well, I mean the guy who wrote it must have been using a Hex editor and the link break was just another two bytes to him, as he could only see "0D 0A" which looks normal, to him... :laugh: :D


                            -Spacix All your skynet questions[^] belong to solved


                            I dislike the black-and-white voting system on questions/answers. X|


                            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