Why can’t I paste SQL code into a post???

  • Rod at work

    SSC-Dedicated

    Points: 33041

    I’ve just spent 20 minutes preparing a new post in the SQL 2008 forum. It took me that long to get to the point where I could post the DDL description of a table, so that people would know what I was talking about. I put in the SQL Code statements necessary for the DDL code. I put in a blank space between the opening and closing tags for the SQL code snippet. Went back to SSMS to generate the CREATE TABLE command, put the cursor back on that line between the opening and closing tags, then I did a Ctrl-V to paste the code. But then

    BAMB!!!

     The editor for this website’s forums just blew me out of the water, sent me straight to the home page of the forums and basically lost 20 minutes of my time! Why does this website do that???

    Kindest Regards,RodConnect with me on LinkedIn.

  • Phil Parkin

    SSC Guru

    Points: 243186

    Rod at work - Friday, February 9, 2018 11:17 AM

    I've just spent 20 minutes preparing a new post in the SQL 2008 forum. It took me that long to get to the point where I could post the DDL description of a table, so that people would know what I was talking about. I put in the SQL Code statements necessary for the DDL code. I put in a blank space between the opening and closing tags for the SQL code snippet. Went back to SSMS to generate the CREATE TABLE command, put the cursor back on that line between the opening and closing tags, then I did a Ctrl-V to paste the code. But then

    BAMB!!!

     The editor for this website's forums just blew me out of the water, sent me straight to the home page of the forums and basically lost 20 minutes of my time! Why does this website do that???

    That’ll teach you. Time for an upgrade to a more recent version of SQL Server, which should fix this stuff :laugh:


    Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this [/url]link.

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

    Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.

  • HappyGeek

    SSCoach

    Points: 18642

    It is an inner secret; at best, anything you may post looks crap: Try copying and re pasting! It just makes it worse with each iteration. For some odd reason I do not think that postings on here are influenced by what version of SQL Server you have installed on some remote server you may not be connected to. I sympathise and hope that someone can offer a solution!? NB writing this I got the ome page twice!!

    ...

  • Chris Harshman

    SSC-Forever

    Points: 41583

    I tend to paste everything into Notepad and then copy and paste it into the forums from there.  I’ve seen it do strange things even if I’m copying and pasting from this website back into this website.  :hehe:

  • Phil Parkin

    SSC Guru

    Points: 243186

    HappyGeek - Friday, February 9, 2018 12:53 PM

    For some odd reason I do not think that postings on here are influenced by what version of SQL Server you have installed on some remote server you may not be connected to.

    You know I was joking, right?


    Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this [/url]link.

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

    Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.

  • Sue_H

    SSC Guru

    Points: 89401

    Phil Parkin - Friday, February 9, 2018 2:02 PM

    HappyGeek - Friday, February 9, 2018 12:53 PM

    For some odd reason I do not think that postings on here are influenced by what version of SQL Server you have installed on some remote server you may not be connected to.

    You know I was joking, right?

    What? And I already upgraded everything…….

  • Steve Jones – SSC Editor

    SSC Guru

    Points: 713642

    The formatting from SSMS is problematic. It has various forms, and this editor doesn’t handle it great. The best thing I’ve found is to paste, then highlight the code here and choose SQL Code at the bottom of the edit box. Even that sometimes doens’t work with strange mixes of CHR(10), CHR(13), and HTML tags, so I try to be careful. Overall, if you aren’t sure about the code, just paste it in.

    Also, if it’s more than 5 minutes work, I often use CTRL+A, C a few times as I’m working to be sure I have a copy. Maybe paste in Notepad to save it.

  • Jeff Moden

    SSC Guru

    Points: 993363

    Steve Jones - SSC Editor - Friday, February 9, 2018 2:57 PM

    The formatting from SSMS is problematic. It has various forms, and this editor doesn't handle it great. The best thing I've found is to paste, then highlight the code here and choose SQL Code at the bottom of the edit box. Even that sometimes doens't work with strange mixes of CHR(10), CHR(13), and HTML tags, so I try to be careful. Overall, if you aren't sure about the code, just paste it in.

    Also, if it's more than 5 minutes work, I often use CTRL+A, C a few times as I'm working to be sure I have a copy. Maybe paste in Notepad to save it.

    The old one (sql code tags)  that you folks tweaked worked fine.  Any chance of resurrecting that?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

    Helpful Links:
    How to post code problems

  • Rod at work

    SSC-Dedicated

    Points: 33041

    Steve Jones - SSC Editor - Friday, February 9, 2018 2:57 PM

    The formatting from SSMS is problematic. It has various forms, and this editor doesn't handle it great. The best thing I've found is to paste, then highlight the code here and choose SQL Code at the bottom of the edit box. Even that sometimes doens't work with strange mixes of CHR(10), CHR(13), and HTML tags, so I try to be careful. Overall, if you aren't sure about the code, just paste it in.

    Also, if it's more than 5 minutes work, I often use CTRL+A, C a few times as I'm working to be sure I have a copy. Maybe paste in Notepad to save it.

    Hmmm. I had done it where I put in the SQL tags first then tried pasting the code into it. So, what I hear you saying is I should I posted the code first, then surrounded it with the SQL tags. OK, I can try that.

    Kindest Regards,RodConnect with me on LinkedIn.

  • Steve Jones – SSC Editor

    SSC Guru

    Points: 713642

    Either way should work. I sometimes put the tags in, then the code. Sometimes the other way. Both seem to work, and occasionally, both fail miserably.

    The entire editor changed with the  forum upgrade, so codes and formatting from pasting is different. We can’t go back as that’s a large change from this editor, plus it removes the ability to apply patches from the vendor.

  • Rod at work

    SSC-Dedicated

    Points: 33041

    Chris Harshman - Friday, February 9, 2018 1:57 PM

    I tend to paste everything into Notepad and then copy and paste it into the forums from there.  I've seen it do strange things even if I'm copying and pasting from this website back into this website.  :hehe:

    I also paste into Notepad or Notepad++, then into whatever website I’m pasting it into. I did in this case as well. It still blew me out of the water, all the way back to start.

    Kindest Regards,RodConnect with me on LinkedIn.

  • Steve Jones – SSC Editor

    SSC Guru

    Points: 713642

    What browser are you using? Are there any strange characters in the post?

  • Rod at work

    SSC-Dedicated

    Points: 33041

    Steve Jones - SSC Editor - Sunday, February 11, 2018 5:32 PM

    What browser are you using? Are there any strange characters in the post?

    In this case, MS Edge. I have used Chrome in the past, but after spending 20 minutes at it I didn’t want to spend another 20 minutes with a different browser.

    Kindest Regards,RodConnect with me on LinkedIn.

  • Steve Jones – SSC Editor

    SSC Guru

    Points: 713642

    Interesting. I primarily post in FF and Chrome. Never use Edge. I’ve seen weirdness on too many sites.

  • Eric M Russell

    SSC Guru

    Points: 124900

    I’m using Chrome. Whenever I right click within this site’s post editor window, I have the menu open ‘Paste as plain text‘. I’ve found that works better than regular ‘Paste’ or Ctrl-V when you don’t need or want to carry over formatting.


    "The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."

Viewing 15 posts - 1 through 15 (of 18 total)

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