Multi-Row Variable Assignment and ORDER BYCommented on: 4 years ago
(February 4, 2010)
These lists are often for a child table, where the covering index is likely to be on the foreign key from the parent table, plus the key for the child entity. But it's good to know that these bloody-...
T-SQL Challenge – Efficient Partitioned TOPCommented on: 5 years ago
(October 2, 2009)
With a smaller number of rows, the CTE solution seems more efficient than this time-proven GROUP BY syntax. Putting the two queries in a batch, the CTE takes up around 36%.
select t1.grp, t1.col1,...
Catch That Bug! Random Row per GroupCommented on: 8 years ago
(October 20, 2006)
In order for the subquery to pick a random entry, you need to drop the ORDER BY clause, rather than using one.
Not sure why not all EmployeeId-s are returned, but this behaviour may already...
Digital Magazine Archives
Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.
Make no mistake about it, the signs that the Illuminati exist are all around us. You can find their markings on our buildings, on our currency and even in our music videos. That’s right, they’re everywhere!...More
With Linked Servers configured to allow cross-host or cross-box communication between the servers you’re using to host your AlwaysOn Availability Groups, it’s time to start looking at some scripts that can be used to regularly check whether or not SQL Server Agent jobs are correctly synchronized across all servers in your topology....More