Start a new topic

Disable client side comment stripping

[This topic is migrated from our old forums. The original author name has been removed]

Hi, We've recently noticed that comments in our stored procs are missing after the sproc is applied to the database using DbVisualiser. I've tracked this down to the Tools -> Tool Properties -> SQLCommander -> Comments settings where you can specify the comment tokens and DbVis will remove the comment prior to sending the statement to the server. Is there any way to disable this functionality and have the comments sent to the server and therefore kept withing the stored procedure source when viewed using sp_helptext commands? As a workaround, we changed the tokens to be something we knew would not be used, but this did have the side effect of stopping the syntax highlighting of working in the editor. Many thanks, Stu

[This reply is migrated from our old forums. The original author name has been removed]

Re: Disable client side comment stripping
Thanks Hans. That works exactly as we would like. Apologies for not spotting it myself. Many thanks and great work on an excellent product. Regards, Stu
[This reply is migrated from our old forums.]

Re: Disable client side comment stripping
Hi Stuart, Sorry, I forgot that we actually made it possible to disable stripping of comments a few releases back. In the SQL Commander menu, you find a Strip Comments When Executing toggle. Please give it a try. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Disable client side comment stripping
Hi Hans, Thanks for the prompt reply. The procedure editor approach does not quite work for us because a) we version control the stored procedures and work with them as files on the filesystem (rather than opening them from the database) and DbVis opens these in SQL Commander windows. b) The stored procs contain commented out usage samples and test exec statements at the end that we like to be able to run after applying the new stored procedure, something that we would not be able to do from the procedure editor window. The SQL Block approach will not work for us because we need to process these files outside of dbVisualiser as part of pour build and promotion scripts, and the --/ and / delimeters will cause issues downstream. The execute buffer approach might help, but it is useful to be able to run just snippets of the buffer, and it is a little inconsistent if the comments are kept when executing the full buffer but removed when executing just a selection. I've noticed that one other side effect of the workaround we adopted is that the comment / uncomment feature is also affected to such a point that it's not a viable workaround.
[This reply is migrated from our old forums.]

Re: Disable client side comment stripping
Hi Stuart, We recommend using the Procedure Editor when editing a procedure, function, trigger etc. It does not strip off any comments. If you have to use the SQL Commander, you can use Execute Buffer to execute the CREATE statement instead of Execute, or use SQL Block delimiters (--/ and /) around the CREATE statement and comments. Both these options sends the comments to the database along with the statement. Best Regards, Hans