copy to code
After I create a query in Sql Management Studio, what I usually do is copy the sql to code. I'm programming in c# and when I copy the sql to code, I must add parentheses at the start and the end of each line with also a '+' character to tells compiler to combine line.
A very beautiful feature would be to add a shortcut to copy the sql into the clipboard but with these parentheses and '+' character. After that, I just simply have to paste it without error directly into my code.
Another very beautiful feature would be to have exactly the opposite; a 'paste from code' that automatically remove all parentheses and '+' character that allow me to execute the sql query without additionnal manual step.
-
Nick Albrecht commented
This is an old suggestion, but I thought I'd mention that if you're able to use the more recent versions of C#, this issue is more or less moot after they added support for raw string literals.
var sqlQuery = @"""
select Col1, Col2
FROM MyTable
WHERE Col3 > 5
"""; -
Thang Phan commented
Wow, I use this feature often but had to rely on another package to do this. I've been waiting for this feature for years and finally decide to suggest but it looks like this suggestion has been here for nearly 10 years! It's such a useful and convenient feature yet it's a wonder there are not enough upvotes. I wonder how others are doing this!
-
Michael commented
I agree, this would allow me to stop using SQL Beautifier - SQL Pretty Printer for SSMS
-
Samuel Tremblay commented
Sorry for the terme 'Parenthese', I meant 'Double quotes' :(