755 reputation
311
bio website
location Finland
age
visits member for 1 year, 9 months
seen 13 hours ago

Former ASP.NET Web Forms developer of 2 years, I'm currently working as one of the DBA's in a large project. TSQL scripting has become an increasingly interesting subject to me on a personal level, as I thoroughly enjoy doing it.


2d
comment Outer Apply vs Left Join Performance
Logically, APPLY is called for every row in the left hand side of the query. In reality though, the execution planner will decide how to handle it in the context of the entire query, so it can sometimes be very hard to know beforehand whether a join or an apply will prove the better option. Best to just try both, compare their execution plans, see if you can make any adjustments, and go with that.
Aug
19
answered Simple SQL Query
Aug
7
comment AlwaysOn Secondary Replica DB-size
Thanks for the quick answer! Apparently sp_spaceused / sp_helpdb showed the space usage correctly after all. What got me confused was comparing them to a slightly older copy of the DB, which contained more unused space amounting to the same total space used. That combined with my not understanding the filesystem .mdf timestamps got me properly confused. Thank you for your time!
Aug
7
accepted AlwaysOn Secondary Replica DB-size
Aug
7
asked AlwaysOn Secondary Replica DB-size
Jul
29
awarded  Notable Question
Jul
28
comment INSERT/SELECT slow after TRUNCATE TABLE on table with 6 over mllion rows
As others pointed out, truncating basically leaves all statistics and indexes all outdated and fragmented. Also, if your table is basically a dump table for data, you might want to alter it as a heap instead of clustered (which I assume it is). Heaps are ideal for pretty much nothing, except for huge bulk inserts. Either way, to read data from there you'll need to update the statistics for the query planner to have any clue what the data looks like and how it's ordered.
Jul
25
revised Estimate projected database growth
deleted 146 characters in body
Jul
25
answered Estimate projected database growth
Jul
24
comment SQL Server NULL values UNDO
He's new, and inexperienced, and the question is valid for someone like that. So instead of this liberal "let's give attitude and vote down everyone new and vote up everyone with gold on their stats" how about we give the guy a break and do what this site was meant for: offer help? Namely, if you have access to another DB, excel, file etc with the same data with the WL:5 values (which is often the situation in test), you can use that to update everything WL:5 except those rows. Or as mehdi said below, just restore your last backup. And in the future, use rollback blocks to check first.
Jul
16
revised CDC auditing - Unanswered questions
Answered a few of my own questions, in case someone else later wanders in here.
Jul
16
comment CDC auditing - Unanswered questions
Great point and I was wondering about that. I would assume that since our service windows always include pulling the system unavailable for a time, that there's enough time to fetch the data from log. But how can I be sure? Is there a way to check this manually?
Jul
15
comment CDC auditing - Unanswered questions
Hey thanks! I had bumped into that same post while trying to find out more, but I hadn't actually read the link referred to in that post. Lots of useful information there. Also, I've now tested sp_cdc_disable_table, and with that there's no problem regarding schema changes. Just need to drop the CDC-tracking for specific tables, make all adjustments to the other AUDIT objects, and re-enable CDC for the table to automatically update CDC to the currently active table schema. Thanks a lot for the help here!
Jul
14
comment CDC auditing - Unanswered questions
Not sure I understand what you mean here. The changes are nothing dramatic, simply removing, adding and modifying existing columns based on software version requirements.
Jul
11
asked CDC auditing - Unanswered questions
Jul
2
awarded  Curious
May
20
revised Network and memory waits after massive ALTER
added 565 characters in body
May
19
comment Network and memory waits after massive ALTER
We've been running several different DMV's, using SQL Sentry etc trying to diagnose the issues. These weird waits and blocks have appeared for a week now, and today we have the first really positive looking result. One of our background processing servers was bugged up and stuck. Only there was nothing in the DB pointing to that server specifically over all the others... Now for the past 2 hours, things have been working perfectly for the first time in a week though, so here's to hoping for the best!
May
19
revised Network and memory waits after massive ALTER
added 21 characters in body
May
19
asked Network and memory waits after massive ALTER