Viewing 15 posts - 4,471 through 4,485 (of 7,610 total)
It's not nearly that complicated to get the nth given day of any month:
DECLARE @SecondTuesdayOfMonth_InThreeMonths datetime2
--set to last possible day = 14th of month, then ...
SET @SecondTuesdayOfMonth_InThreeMonths = DATEADD(DAY, 13,...
January 19, 2016 at 2:42 pm
SQL Agent schedules all of it jobs from msdb, and I don't see anything that looks like a calendar table in it.
Keep in mind, too, you've also created a potential...
January 18, 2016 at 11:18 am
Orlando Colamatteo (1/16/2016)
ScottPletcher (1/16/2016)
It's more efficient to avoid I/O when you can.
There could be a trade off for CPU and coding effort. If you wrapped the calculation into an iTVF...
January 16, 2016 at 12:47 pm
Orlando Colamatteo (1/16/2016)
ScottPletcher (1/16/2016)
January 16, 2016 at 11:38 am
It simply probably didn't occur to the SSMS developers at the time to visually mark it. They probably didn't deal with disabled indexes at the time and almost certainly...
January 16, 2016 at 11:25 am
Simple mathematical calcs could give you any of those dates, with no need for I/O against a table. But I'm also not attempting actual code without existing data definitions/DDL.
January 16, 2016 at 11:07 am
I think this will do the same thing, much more simply and clearly:
Declare @StartDate DATETIME,
@EndDate DATETIME
if DAY(@StartDate) >= 7
set @StartDate = DATEADD(day, -15, DATEADD(DAY, DATEDIFF(DAY, 0,...
January 15, 2016 at 5:54 pm
For a BULK INSERT, you'd typically want to take a table lock anyway, to allow minimal logging (edit: and reducing locking and logging overhead as much as possible) . ...
January 14, 2016 at 1:52 pm
Hugo Kornelis (1/13/2016)
ScottPletcher (1/13/2016)
Slapping an identity on the table isn't particularly damaging in and of itself.
It actually is. If not needed, it is a waste of storage both on disk,...
January 13, 2016 at 2:21 pm
No, I wouldn't worry about indexing/clustering for the other result sets if they are created as part of the main query.
January 13, 2016 at 1:25 pm
Isn't this q just a duplicate of http://www.sqlservercentral.com/Forums/Topic1752199-3077-1.aspx
January 13, 2016 at 1:10 pm
As noted, you could compress the earlier partitions and not the current ones.
Also, carefully review the fillfactor and make sure it really should be as low as 80%. That's...
January 13, 2016 at 1:08 pm
For only 50 rows from each, you'll very likely be OK regardless. Still, before loading the intermediate tables, cluster them on the join key(s).
January 13, 2016 at 12:37 pm
Is the "base length" of the columns at least the same? That is, when you say the value is the same except chars are added, is the initial value...
January 13, 2016 at 10:39 am
Hugo Kornelis (1/13/2016)
ScottPletcher (1/13/2016)
In particular, don't just slap an identity on the tableand assume that's automatically the best clustering key.Fixed that for you. 😉
Not at all :-D. Slapping...
January 13, 2016 at 9:42 am
Viewing 15 posts - 4,471 through 4,485 (of 7,610 total)