Viewing 15 posts - 3,091 through 3,105 (of 10,143 total)
Try this. It might give you some ideas.
SELECT
cp.ServerID
, ds.[server]
, cp.MetricID
, dm.BaseMetric
, cp.MetricValue
, x.RAGLevel AS RAGSTATUS
--INTO RAGTemp
FROM DataTable cp
LEFT JOIN DimExServer ds
ON ds.ServerID = cp.ServerID
LEFT JOIN DimExMetric dm
ON...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 5:16 am
Something like this?
DECLARE @MinPeriod int
SELECT @MinPeriod = MIN(a.period)
FROM agr.dbo.atrans a
CROSS APPLY (
SELECT CutOffTid = ISNULL(MAX(ccas_id),0)
FROM dbo.fbs_trans
) x
WHERE a.agrtid > x.CutOffTid
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 4:44 am
Have you tried timing each statement?
DECLARE @Starttime DATETIME = GETDATE()
DECLARE @CutOffTid int
SELECT @CutOffTid = isnull(max(ccas_id),0)
FROM dbo.fbs_trans (NOLOCK)
print 'Cut Off ID is ' + cast(@CutOffTid as char)
SELECT Starttime = @Starttime, Endtime...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 4:09 am
-- change the index to support a nested loops join between rs and r
-- with seeks to r on id and residual predicate of RNT and Man:
create nonclustered index...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 3:13 am
Spid -3 is a deferred transaction, Paul Randall blogs about it here[/url].
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 2:51 am
Hugo Kornelis (7/21/2014)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 22, 2014 at 2:27 am
Minnu (7/21/2014)
i want to store the older records away by creating partitions.
my overrall request is,...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 9:56 am
Minnu (7/21/2014)
and this table is mainly used for OLAP process only.
Finally...performance of table needs...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 9:32 am
The query you posted - the opening post - doesn't contain the three-part names which are commonly associated with linked servers. How are you running this query?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 9:08 am
DROP TABLE #Events
CREATE TABLE #Events (ID INT IDENTITY(1,1) NOT NULL, EVENTDATE DATETIME)
INSERT INTO #Events VALUES
('2014-07-20 14:42:33.360'),
('2014-07-19 14:42:33.360'),
('2014-07-18 14:42:33.360'),
('2014-07-17 14:42:33.360'),
('2014-07-16 14:42:33.360'),
('2014-07-15 14:42:33.360'),
('2014-07-14 14:42:33.360'),
('2014-07-13 14:42:33.360'),
('2014-07-12 14:42:33.360')
-- filter the table for dates between...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 7:55 am
hoseam (7/21/2014)
declare @ToDate datetime
declare @FromDate datetime
set @FromDate = '1 Feb 2014'
set @ToDate = '28 Feb 0014'
SELECT EVENTDATE,'' AS BRANCHCD, BUSINESS_AREA, CREATE_DATE, WORK_TYPE, QUEUE, STATUS, CREATE_AGE, CATEGORYCD, DELAYREASON1, DELAYREASON2
...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 7:32 am
hoseam (7/21/2014)
I just corrected it and I get this error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
Use CONVERT with...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 7:21 am
What datatype is EVENTDATE?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 7:11 am
Oracle, by any chance?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 6:53 am
Not enough information. Can you post the stored procedure code?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 21, 2014 at 6:46 am
Viewing 15 posts - 3,091 through 3,105 (of 10,143 total)