SQL Server 2017 adds sys.dm_os_enumerate_fixed_drives, a new DMV that shows free space on each drive and replaces xp_fixeddrives. Here is the query I use.
How to Create Temp Table From Stored Procedure? – Interview Question of the Week #140
How do you create a Temp Table from a stored procedure when you do not know its result set? Here is the OPENROWSET approach I use, and its drawbacks.
SQL SERVER – How to Find UNIQUE Key Columns? – sp_special_columns
Want to know which columns uniquely identify a row in a table? The system stored procedure sp_special_columns tells you. Here is a quick demo.
SQL SERVER – System Procedure to List Out Table From Linked Server
The System Procedure sp_tables_ex lists table metadata from an existing linked server. I check its provider and login mapping separately.
How to Show Results of sp_spaceused in a Single Result? – Interview Question of the Week #135
How do you show results of sp_spaceused in a single result? My co-interviewer asked this. I think it is a poor interview question, but here is the answer.
SQL SERVER – How to See Scripts Executing in sp_executesql?
How can you see the scripts executing in sp_executesql without an extra SELECT result set? A reader asked me, and here is the simple answer.
How to Pass Parameters to a Stored Procedure in SQL Server
To pass parameters to a stored procedure, write the values after EXEC without parentheses, and name each parameter so the order can’t matter. This post builds a small order procedure and calls it by position and by name, with defaults, an OUTPUT value and a table-valued parameter. It also shows the three errors people hit first and what each one means.





