RazorSQL How to Search for Data
Users can search databases for data with RazorSQL using the Database Data Search tool. This tool is available as the Search -> Database Data Search menu option. It is also available by right-clicking on a table or view in the database navigator and selecting the "Search" option.
Once the tool is selected, select a database / schema and a table to start the search. Continue by pressing the OK button to get to the main search page. Users can add additional tables to the search criteria by pressing the "Add Table" button. RazorSQL will examine the table to see if there are foreign key references between the original search table and the added table. If there are, these refernences will be pre-selected. If there are no references, the user should select the column references between the search tables.
Once all of the search tables are selected, the criteria for searching the tables can be selected. The search tool contains dropdowns containing the columns for all of the search tables. To search for data in a specific column, select the columns in the dropdown boxes, then select how to search for the column data in the next dropdown (options include operations such as equals, not equals, contains, not contains, contains ignore case, etc.). In the text field, enter the value to use in the search.
Once all of the criteria are selected, press the Search button to execute the search. Users can also press the "Copy SQL to Editor" button to copy the SQL RazorSQL generates for the search to the SQL editor.
An example of a database search would be to search the Department and Employee tables for a department_id of 1 and an employee name containing smith. To do this, the user would first launch the search tool and select the Department table. They would then use the "Add Table" button to add the Employee table to the search. They would then select the deparment_id column in the first dropdown in the first row, the "=" operator in the second dropdown, and enter 1 in the text field. The user would then select the last_name column in the first dropdown in the second row, the "contains (ignore case)" option in the second dropdown, and enter smith in the text field. Hitting search would then search the database and display the results.