Hi @MikeY1975 ,
Do you mean that you add the value the variable like below code,
INSERT INTO table_A
VALUES ('1', '2', '3')
And then when you copy the code to SSMS, it becomes like INSERT INTO table_A VALUES ('1', '2', '3')
?
If yes, I think it's hard to keep the format with the carriage returns.
When you add the sql statement in the value, the format has already changed so we could not keep the sql format.
You may save the sql statement to the local file before adding to the variables and then you may edit it in SSMS with the correct format.
If I misunderstand your need, please incorrect me.
Regards,
Zoe
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.