StrataFrame Forum

Search Panel Not Functional

http://forum.strataframe.net/Topic32240.aspx

By William Fields - 10/23/2013

Hello,

I can't remember if the search feature in the DDT ever worked for me, but when I type something into the Find field and click on the search button, nothing happens... and all of the search options are checked.

???
By Edhy Rijo - 10/23/2013

Hi William,

I use that functionality all the time with VS2012 and MS-SQL2012.  Make sure you are using the SF version 1.7.6.0.
By Ivan George Borges - 10/24/2013

Funny, I had never seen this Search feature. Blush

Anyway, I tried it over here and could reproduce it. It did work on my own Views and Stored Procedures, but wouldn't find anything on the Tables, for example.
By Edhy Rijo - 10/24/2013

Hi Ivan,

I don't think it is designed to look into table fields, at least that is not one of the options in the "Search Options"

http://forum.strataframe.net/Uploads/Images/792bdb01-5454-4cd7-b3f4-1e62.png
Hmmm, I believe I never had the need to search for a field name, all the time for view names, a field in a view, stored procedure, etc.  Anyway, very useful feature.
By Ivan George Borges - 10/24/2013

Hey Edhy!

Yep, that could be it.

Abraços.
By William Fields - 10/24/2013

I'm using v7.6.0 of the DDT, and I'm searching on RAISEERROR.

I have a ton of code in our database with the old RAISEERROR syntax which no longer works in SQL 2012, so I was hoping the find feature would be a quick and easy way to see how many lines of code that need to be touched.

But, when I search, nothing happens at all...

What search term can I use to verify if the find feature is working at all?
By Edhy Rijo - 10/24/2013

Hi William,

Make sure you have checked all the options in the "Search Options" as shown in my previous thread.
By William Fields - 10/24/2013

Yes, I confirmed that in my original post.

Thanks.
By StrataFrame Team - 10/25/2013

Will the search find other things, or is it just RAISEERROR that isn't being found?  If you search for a field name or part of a field name does it find anything?
By William Fields - 10/25/2013

Table names - nothing

Field names - nothing

Code within triggers - nothing

Code within stored procs - results

Funny thing, if I clear out the search term after results from stored procs are found and search again, I get the stored proc results again, and user defined functions.
By StrataFrame Team - 10/25/2013

I just checked the dbo.Search_Query sproc, and it certainly doesn't check triggers.  It only checks sprocs, functions, views, and deploy scripts.  That's the bad news.  The good news is that you can easily modify the stored procedure to return the extra results if necessary.  You won't be able to double-click a trigger from the list and open it for editing, but at least it would return it in the results.  You would need to edit the Search_Query sproc and add this before the "RESULT SET #1" comment at the bottom of the procedure:

   INSERT INTO 
      @results
   SELECT
      5 search_Type,
      TR.tr_pk search_PrimaryKey,
      T.tbl_schema search_Schema,
      T.tbl_name + '.' + TR.tr_Name search_Name,
      D.[db_name] search_Database
   FROM 
      dbo.DBETriggers TR
      INNER JOIN dbo.DBETables T ON TR.tr_tbl_pk = T.tbl_pk
      INNER JOIN dbo.DBEDatabases D ON T.tbl_db_pk = D.db_pk
      INNER JOIN dbo.DBEProfile P ON d.db_dbe_pk = P.dbe_pk
   WHERE 
      P.dbe_pk = @profilePk 
      AND
      (
         (
            @includeCodeBody = 1 
            AND 
            (
               TR.tr_ProcedureCode LIKE @queryText 
               OR
               TR.tr_PreCreate LIKE @queryText
            )
         
         OR
        (
            @includeNamesAndDescriptions = 1 
            AND 
            (
               TR.tr_Name LIKE @queryText 
               OR 
               TR.tr_Description LIKE @queryText
            )
         )
      );
By William Fields - 10/25/2013

Thanks for the reply.

Will this be incorporated into the next DDT version?
By StrataFrame Team - 10/25/2013

Oh yes.  The search on the next DDT will be vastly expanded.  The search on the current version was more of an afterthought.