## Tools ### sqlcmd SQL Server CLI client in [[powershell]] Not a part of SQL Server directly, but SQL Server includes an extension to Powershell called a `powershell provider` ### Server Profiler - SQL Server Profiler - Allows a trace of all commands being sent to SQL Server - Every single thing that requires a command to be sent to SQL Server to do something - Can save log to a file or a table - Also useful when you want to optimize performance of SQL Server and queries ### Database Projects (SSDT) https://docs.microsoft.com/en-us/sql/azure-data-studio/extensions/sql-database-project-extension?view=sql-server-ver16 ### Database Engine Tuning Advisor - Database Engine Tuning Advisor - Optimizes performance of SQL Server - Does this by analyzing the commands it sees being sent to SQL Server and figuring out the best place to put indexes and that sort of thing - Typically you complete a trace using Profiler (above) then feed it into the Tuning Advisor ## Default Ports | Port number | Type | Use | | -------------- | ----------- | ------------------------------------------------------------------ | | 135 | TCP | WMI, MSDTC, Agent file copy, T-SQL debugging | | 80 | TCP | To publish SQL Server Reporting Services (SSRS) reports using HTTP | | 443 | TCP | To publish SSRS reports using HTTPS | | 500 | UDP | IPSec to encrypt connections | | 1024 to 5000 | TCP | Dynamic ports for named instances | | 1433 | TCP | Database engine default instance | | 1434 | TCP and UDP | DAC and the SQL Browse | | 2382 | UDP | SQL Server Analysis Services with dynamic ports | | 2383 | TCP | SQL Server Analysis Services (SSAS) | | 2725 | TCP | SQL Server Analysis Services (SSAS) | | 3343 | UDP | Cluster network driver | | 3882 | TCP | SQL Server Integration Services (SSIS) | | 4022 | TCP | SQL Broker Service | | 4500 | UDP | IPSec | | 5000 to 5099 | UDP | Clusters | | 5022 | TCP | AlwaysOn | | 7022 | TCP | Database Mirroring | | 8011 to 8031 | UDP | Cluster internode | | 49152 to 65535 | TCP | More dynamic ports for named instances |