Reputation
550
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
3 9
Newest
 Editor
Impact
~4k people reached

  • 0 posts edited
  • 0 helpful flags
  • 73 votes cast
1d
revised Insert data between 30 minute time intervals
added 234 characters in body
1d
answered Insert data between 30 minute time intervals
Jun
29
comment Make a column for each count(*) in a day of the week
Thanks for pointing that out. Just shows the danger of trying to use those "day of week" date functions, and it's good to get out of my English-centric thinking. My updated approach ends up looking a bit more similar to yours once I fixed that issue.
Jun
29
revised Make a column for each count(*) in a day of the week
added 1700 characters in body
Jun
29
answered Make a column for each count(*) in a day of the week
Jun
17
answered SQL Server : query code
Jun
17
comment Unexpected update/delete on OLTP database in SQL server 2005
Are you able to make the Contract Status column a computed column based on the date fields? This could help ensure consistency without relying on a nightly process. Alternatively, you might consider a check constraint enforcing that Contract Status cannot be Expired if the Contract Expiry Date has not yet been reached. This would cause the offending code / one-off query to fail, which might be preferable to the current situation where it corrupts the data.
Jun
12
comment Query execution taking long time
You pasted in 3 queries above. Which is the one that is taking 3 minutes? Does each take 3 minutes? Or only the first one, which requests the SQL text as well?
Jun
10
answered Column Store Index over an clustered index (created when primary key is declared) - SQL Server
Jun
8
comment How to organize long Query
The + signs are string concatenation in this case, e.g. SELECT 'a' + 'b' yields 'ab'
Jun
8
answered How to prevent a trigger from running on certain statements?
Jun
5
accepted Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)
Jun
5
comment LEFT OUTER JOIN-ing the same table, grouping, summing and finding 0 or NULL
Sorry I missed this last comment before posting my answer. I agree with Shane; this approach works once the data in the SQL Fiddle is corrected. My answer is just one alternative way to re-phrase this logic, which I didn't realize at first due to the bad mapping in the test data!
Jun
5
answered LEFT OUTER JOIN-ing the same table, grouping, summing and finding 0 or NULL
Jun
5
comment Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)
That's a fascinating article on proportional fill, and it's always fun to learn something new like that! We currently have trace flag 1117 off for this server. The Connect article could be a good idea and I voted for it, but it looks like it's closed as a "Duplicate" without any reference to what it might be duplicating (oops!). Good point on making the case for additional SSD investment; with the way that costs have been going down, this may be feasible. In the meantime, we will test this strategy further and see how it goes!
Jun
5
awarded  Editor
Jun
5
revised Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)
simplify I/O stats to be easier to read
Jun
5
asked Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)
Jun
3
awarded  Yearling
Jun
3
answered Different execution plans during INSERT at @table variable and #temporary table