A quick note on CROSS APPLY: think of it as an inner join to a table valued function that takes parameters, something a regular JOIN cannot do.
SQL SERVER – 2005 – Last Ran Query – Recently Ran Query
Want to see the last ran query on SQL Server 2005? This quick script uses sys.dm_exec_query_stats to list recent queries with the time each one ran.
geometry STEnvelope: A Bounding Box Includes Extra Space
geometry STEnvelope can include points outside the original shape. These two triangle tests keep envelope membership beside exact containment.
Adding a New Year Partition Before the Calendar Rolls Over
Add a new year partition before January data arrives by checking boundaries, preparing NEXT USED, splitting an empty range, and scheduling the work.
GROUPING SETS: Choose Nonhierarchical Subtotals Explicitly
GROUPING SETS lets me choose independent subtotal combinations instead of assuming one hierarchy. I list the groups the report needs explicitly. That can exclude detail rows while retaining summaries across different dimensions.
SQL SERVER – Change Password of SA Login Using Management Studio
How to change password of SA login using Management Studio: log in with Windows Authentication, open the SA login properties, set the new password and test it.







