The default instance uses port 1433, but what about a second instance on the same box? Here is how to find the port SQL Server is listening on.
SQL SERVER – Retrieve Maximum Length of Object Name with sp_server_info
How long can a table name be in SQL Server? The answer is 128, and you can confirm it yourself by running the stored procedure sp_server_info.
Finding What Depends on a Table
Finding What depends on a table starts with sys.dm_sql_referencing_entities, then checks cross-database code and dynamic SQL.
TRUNCATE Permission: Letting a User Empty One Table
Your loader needs to empty a staging table, not redesign it. Here is a small procedure that gives it exactly that.
SQL SERVER – Select Columns from Stored Procedure Resultset
Need only some columns from a stored procedure resultset? Store it in a temp table with INSERT INTO and EXEC, then select what you need.
Table-Valued Parameters: Sending Thousands of Rows in One Call
Send thousands of rows in one call with table-valued parameters, compare round trips, and handle missing column statistics accurately.
SQL SERVER – Disk Space Monitoring – Detecting Low Disk Space on Server
A common question I get: how do you go about detecting low disk space on SQL Server? Here are two ways, including xp_fixeddrives, and the one I prefer.






