This article describes how to include external references in analysis and how to filter objects to speed up the process.
Beside internal database references in SQL Server, ApexSQL Clean can also analyze dependencies in external databases and applications.
To include external SQL Server databases in dependency analysis in the New project dialog under the External databases tab select additional databases:
All references from the external databases will be shown for a selected object in the Results grid:
To include project files from external applications:
- Click the Advanced tabs button in the New project dialog
- Under the Files tab in the Look up in section:
- 2.1. To add an external application project file click the Add button and browse to the project file:
Using the Add button you can add a specific .NET solution (.sln) file or a .NET project file (.csproj or .vbproj )
- 2.2. To add a folder with client code, click the Add folder button:
Using the Add folder button you can add folders that contain C++, ASP, Delphi, or any other client code
References from all included files will be shown in the Results grid:
Customizing file search
To customize the list of files from the added folder to be searched in the analysis process you can filter the list of files using the regular expressions. Under the File Name Patterns option click the Add button to create custom patterns:
In the Add pattern dialog add the pattern expression and click OK:
If the client code was written in C#, then use a file name pattern .cs so only the files containing or ending with .cs are analyzed for SQL dependencies. To match the very last extension, use the file pattern .cs$ in the same way code created in Visual Basic will use the .vb and .vb$ patterns.
The Comments to ignore option contains a list of comments from client code to be ignored. To add a comment template to the list click the Add button:
In the Add comment dialog choose the type of comment:
If close delimiter is applied, comment will be treated as multiline, and if close delimiter is left empty, it will be considered as the single line comment.
The Match case option is used to make search for objects in source code files case sensitive and the Match whole word only option is used for matching the whole word only:
To customize and speed up the analysis use the under the Object filter tab select the object types for analysis:
Object selection can also be used in the ApexSQL Clean CLI for each selected combination by using the Bitwise set and adding a switch “/o:”.