Viewing 15 posts - 4,351 through 4,365 (of 7,615 total)
You could also consider using an A/B table approach. That is, the nightly load goes into a different table name. When the load process is complete, either the...
April 1, 2016 at 10:24 am
Most likely a LOOP join will be used. That is not guaranteed, of course, but it is likely.
If you want to be sure what join algorithm will be used,...
April 1, 2016 at 10:18 am
Look at the tempdb log file size and growth amount, particularly if it is a % (which you should change to a fixed amount: never use %, no matter what...
April 1, 2016 at 10:08 am
Alan.B (3/31/2016)
1. Nothing I posted uses recursion. Look again.
2. People should put unique nonclustered indexes on their dim_date or calendar but dont. It's not like it gets modified all...
April 1, 2016 at 9:02 am
We don't really know why MS chose to make the PK by default also the clustering index.
Personally I think it was more about making it "easy to use" so it...
March 31, 2016 at 10:51 am
You should definitely cluster the temp table on the key column as well. It can't hurt, but it can help under certain conditions.
SELECT TOP (0) D.X INTO #tmp FROM...
March 31, 2016 at 9:46 am
Luis Cazares (3/31/2016)
and the PK needs an index to work correctly
Hmm, not sure what you mean there. There's no problem at all explicitly creating a PK as nonclustered, even...
March 31, 2016 at 9:35 am
souLTower (3/30/2016)
March 31, 2016 at 9:26 am
Simply because Microsoft chose to assume that a PK would also automatically be the clustering key (if one didn't already exist, of course). Other dbms's don't make that assumption,...
March 31, 2016 at 9:22 am
Alan.B (3/30/2016)
Alan.B (3/30/2016)
ScottPletcher (3/30/2016)
Alan.B (3/30/2016)
ScottPletcher (3/30/2016)
Alan.B (3/29/2016)
Lastly, ditto the last Thursday of the month:
SET STATISTICS IO ON;
PRINT 'Old way:';
SELECT DISTINCT MAX([Date]) OVER (PARTITION BY [Year],[MonthName],[WeekdayName]) AS [Date]
FROM ...
March 31, 2016 at 8:44 am
Alan.B (3/30/2016)
ScottPletcher (3/30/2016)
Alan.B (3/29/2016)
Lastly, ditto the last Thursday of the month:
SET STATISTICS IO ON;
PRINT 'Old way:';
SELECT DISTINCT MAX([Date]) OVER (PARTITION BY [Year],[MonthName],[WeekdayName]) AS [Date]
FROM dbo.itvf_CALENDAR('01/01/2014','12/31/2014')
WHERE ...
March 30, 2016 at 11:52 am
Alan.B (3/29/2016)
Lastly, ditto the last Thursday of the month:
SET STATISTICS IO ON;
PRINT 'Old way:';
SELECT DISTINCT MAX([Date]) OVER (PARTITION BY [Year],[MonthName],[WeekdayName]) AS [Date]
FROM dbo.itvf_CALENDAR('01/01/2014','12/31/2014')
WHERE [WeekdayName]...
March 30, 2016 at 8:39 am
SELECT DATENAME(MONTH, CAST('01-' + string AS date)) + SPACE(1) +
CAST(YEAR(CAST('01-' + string AS date)) AS varchar(4))
FROM (VALUES('Dec-15'),('Jan-16'),('Feb-16')) test_data(string)
March 29, 2016 at 9:13 am
A couple of things to consider.
1) Change the PRINT @<sql_variable> to SELECT @<sql_variable>, since SELECT can display many more chars than SELECT.
2) Explicitly cast the unicode literal in the SET...
March 29, 2016 at 9:07 am
You could create a logon trigger to capture which logins are being used, and how often.
March 28, 2016 at 1:05 pm
Viewing 15 posts - 4,351 through 4,365 (of 7,615 total)