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. MS SQL MS - Trim Trailing Spaces (not in the data...)

MS SQL MS - Trim Trailing Spaces (not in the data...)

Scheduled Pinned Locked Moved Database
databasecsssql-serversysadminhelp
4 Posts 2 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.
  • A Offline
    A Offline
    ammills01
    wrote on last edited by
    #1

    I am using Microsoft SQL Server Management Studio 2005 v9.00.4035.00. When I view an existing stored procedure and copy the text or grid results to a new query window there are always several spaces after each line, and in some cases a ton of extra space. Before I commit any modifications to the stored proc I have to take the text into a text editor and trim the trailing spaces (okay, I guess I don't HAVE to but it just annoys me). I was wondering if anyone has a better method of accomplishing this goal. I can't seem to find anything in options or any plugins I can install that will do this. Every time I try and Google this all I get is results on how to trim trailing spaces from the dataset you are returning. Thanks in advance for your help!

    C 1 Reply Last reply
    0
    • A ammills01

      I am using Microsoft SQL Server Management Studio 2005 v9.00.4035.00. When I view an existing stored procedure and copy the text or grid results to a new query window there are always several spaces after each line, and in some cases a ton of extra space. Before I commit any modifications to the stored proc I have to take the text into a text editor and trim the trailing spaces (okay, I guess I don't HAVE to but it just annoys me). I was wondering if anyone has a better method of accomplishing this goal. I can't seem to find anything in options or any plugins I can install that will do this. Every time I try and Google this all I get is results on how to trim trailing spaces from the dataset you are returning. Thanks in advance for your help!

      C Offline
      C Offline
      Corporal Agarn
      wrote on last edited by
      #2

      Is you output datatype TEXT or CHAR, you may want to look at VARCHAR.

      A 1 Reply Last reply
      0
      • C Corporal Agarn

        Is you output datatype TEXT or CHAR, you may want to look at VARCHAR.

        A Offline
        A Offline
        ammills01
        wrote on last edited by
        #3

        Thanks for your response on this however I am not referring to any output that I can control the datatype of. I am referring to the text that SMS brings up when you view an existing stored proc or view.

        C 1 Reply Last reply
        0
        • A ammills01

          Thanks for your response on this however I am not referring to any output that I can control the datatype of. I am referring to the text that SMS brings up when you view an existing stored proc or view.

          C Offline
          C Offline
          Corporal Agarn
          wrote on last edited by
          #4

          Okay I see what you mean... I have not had a big problem with this as I usually have no trailing characters. There might be a setting about trailing characters, but I cannot remember. Sorry I cannot help. djj

          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