Pete and I were working on a project this afternoon, and it involved building queries in Sql Server Query Analyzer, then copying them over into our code.

As you can imagine, the process of pasting a multi-line query into our code then converting it to a multi-line literal string was quite a chore, so I decided to go looking for a way to speed it up.

Before long I found Alex Papadimoulis' Smart Paster addin for Visual Studio. It lets you paste the clipboard contents in a variety of formats, including a literal string. You can even define whether you want carriage returns and indentation preserved in the string! This was a real time saver, so go grab it if you find yourself repeating that tiresome "insert quotes and plus-signs" chore.

One addition I'd like to see: The ability to specify whether the plus-signs appear at the end or beginning of the lines. Alex seems to prefer that they appear at the end, whereas I like 'em at the begining of the subsequent line.