Question: How to Create a Table Automatically in All Newly Created Databases? This question was recently asked in my recent consulting engagement
DATETIMEFROMPARTS Function: Build Dates From Parts
The DATETIMEFROMPARTS function builds a datetime value from seven numbers, with no string conversion and no language trap. This post tests how it rounds milliseconds, which parts raise an error, how it treats NULL, and how its relatives build dates, times and offsets.
Runnable Sessions in SQL Server: What to Check Next
Runnable sessions are sessions that have everything they need except a free CPU. This post counts requests by status, checks that SQL Server can see every processor, reads the settings that cap CPU use, and lists the statements waiting in the queue, so a long queue next to a half idle CPU stops being a puzzle.
How to Skip Top N Rows in SQL Server? – Interview Question of the Week #237
Question: How to skip top N Rows in SQL Server and retrieve the rest of the rows? Answer: I had asked the above question in one of the interviews last week.
OFFSET FETCH in SQL Server: Get Rows 21 to 30 After ORDER BY
OFFSET FETCH reads a block of rows from the middle of a sorted result. The demo returns rows 21 to 30, builds pages from a page number and measures why deep pages cost more. A seek based alternative reads the same two pages every time.
How to Write in Text File from T-SQL in SQL Server? – Interview Question of the Week #236
Question: How to Write in Text File from T-SQL in SQL Server?
The question above was actually asked in an interview and also was not asked in the same word.







