Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to remove the commented notes in stored procedure?

    Hello, everyone:

    There are some commented notes in the stored procedure from clients. Is there any way to remove these notes automatically, I mean using scripts etc.

    Thanks

    ZYT

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What ever for? Are they rude comments? Are they misleading? Are they lies? Do they disparage members of your immediate family?

    Comments are there for a purpose. They help future DBAs understand what the procedure is doing. They in no way hinder the performance of the code. Leave them be.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Mar 2003
    Posts
    223
    We want to check some special words in stored procedures. Commented notes will make confusion.

  4. #4
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Then perhaps one solution would be to script your database, write a little MS Word (or other editor) macro to remove the comments, and then do your searching. Maybe not a 100 easy solution, but one that would preserve the comments in the actual DB's stored procedures.

    Creating such a macro would be a fairly trivial task in most editors.
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, the problem is that you are going to need to identify both single-line comments (with '--' characters) and block comments (bracketed by '/*' and '*/'). Rotsa-Ruck getting it to work reliably, though.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Problem? What problem? I have a UltraEdit script at home that does the /* */ ('C' programming anyone?) stuff...and would THINK that the -- stuff would be easy also (find "--", delete to EOL).

    But as far as reliability...I would be concerned about that...for instance, now that I think about it, my UE macro might not work correctly for /* /* */ */ stuff...

    And if it was me, I'd do the searching with the comments staying put. I would think considerably less hassle. You can weed out the comments from the output easier than pulling them from the procs, I would think.
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •