Viewing 15 posts - 3,631 through 3,645 (of 7,609 total)
That's going to be a royal pita.
Why not just stop using different names for dev and prod? It's easier to mess up the aliasing than it is to...
December 26, 2017 at 2:41 pm
From Books Online, under sys.dm_db_index_operational_stats:
December 26, 2017 at 9:11 am
Go by the values in the clustered index. For example, if the table is clustered on a datetime column, use that as the value for the UPDATE.
Here's a...
December 22, 2017 at 8:27 am
December 22, 2017 at 7:15 am
The key lookups should cost more than the sort for only 7 rows (I know the lookup is in both queries). You should consider adding DateRegistered to the NC lindex.
December 21, 2017 at 3:11 pm
Be sure to create a unique clustered key / primary clustered key on SiteKey in the #Sites tables. With only ~20+ rows it may not matter, but it can't hurt.
December 21, 2017 at 11:13 am
DayOfWeek 7 is ambiguous in SQL Server, since SQL allows the week to start on any day that you specify.
Instead, I'd strongly urge you to use known day...
December 21, 2017 at 9:51 am
If you can, TRUNCATE the table rather than DELETE all the rows, as trunc will be much less overhead (btw, in case you're wondering, a trunc can be rolled back...
December 19, 2017 at 2:29 pm
Sorry about the HOUR(), that's the one function I always forget doesn't exist. Per quarter for the current year, something like this:
select
DATEPART(quarter,...
December 19, 2017 at 12:51 pm
Not 100% sure what you need, but, for example, this gives sales for the latest quarter for >=7AM and <8AM:
select *
from TicketItem
where s_item...
December 19, 2017 at 11:19 am
Below is alternative method that's closer to the original technique (for good or ill). Btw, there's a minor bug in the other code that doesn't reduce the day count if...
December 19, 2017 at 8:28 am
December 15, 2017 at 8:00 am
Your pattern requires two spaces between the date and the time, and your value only has one space.
Also, you didn't explicitly specify the \ as the escape character:
December 15, 2017 at 6:50 am
Impossible to say. It depends primarily on (1) how much free space is available in each page already, (2) as noted already, how many affected indexes there are on each table.
December 15, 2017 at 6:46 am
Select
t1.Salesagent,
SUM(CASE WHEN MONTH(t1.DateCompleted) BETWEEN 1 AND 3 THEN 1 ELSE 0 END) AS Quarter1_Sales_Count,
SUM(CASE WHEN MONTH(t1.DateCompleted) BETWEEN 4 AND ...
December 14, 2017 at 10:24 am
Viewing 15 posts - 3,631 through 3,645 (of 7,609 total)