Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2014
    Posts
    1

    Question Unanswered: Search not-comment text in syscomment

    Hi everyone and thank you for your help
    I am looking the way to search what objects are referenced by another objects.
    Until now, I have used this
    Code:
    declare @texto varchar(50);
    begin
    set @texto='uvw_Personal_X_Area';
    SELECT     TOP 100 PERCENT OBJETOS.xtype, COMMENTS.text, OBJETOS.name FROM 
            BD_SCC_17.dbo.syscomments COMMENTS
             INNER JOIN BD_SCC_17.dbo.sysobjects OBJETOS 
             ON COMMENTS.id = OBJETOS.id WHERE   ((OBJETOS.xtype = 'p')
              AND (OBJETOS.status >= 0) OR (OBJETOS.xtype = 'fn') 
              AND (OBJETOS.status >= 0) OR (OBJETOS.xtype = 'u') 
              AND (OBJETOS.status >= 0) OR (OBJETOS.xtype = 'tr') 
              AND (OBJETOS.status >= 0) OR (OBJETOS.xtype = 'v')
              AND (OBJETOS.status >= 0)) AND ( COMMENTS.text LIKE N'%' + @texto + '%') ;
    End;
    The problem with this is that it doesn't distinguish when the objects isn't used, specifically when it's commented.
    Is there any form to search only the not commented text?
    Thanks!

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    sysdepends

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    This massaged two shorts.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

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