Viewing 15 posts - 3,076 through 3,090 (of 10,144 total)
The easiest solution would be to save the query as a view on server ENIQSQLSERVER.
July 29, 2014 at 2:17 am
vignesh.ms (7/24/2014)
Hi there ,I got this code from web, I cant understand how it works
can anybody suggest me with links or explanations about the below used techniques.
.
.
.
An...
July 24, 2014 at 8:30 am
-- make a table with two rows, two columns
DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(20))
INSERT INTO @t(data) SELECT 'Jacob'
INSERT INTO @t(data) SELECT 'Sebastian'
SELECT * FROM @t
GO
----------------------------------------------------------------------------------------------------
DECLARE @t TABLE(...
July 24, 2014 at 8:29 am
mallikachowdhary 98955 (7/24/2014)
I have run the query on both the servers will post the execution plan once it runs, normally when running the same...
July 24, 2014 at 3:30 am
Compare the execution plans. Since the queries take so long to run, begin with the estimated execution plan. They will highlight differences between the two servers - say an index...
July 24, 2014 at 2:15 am
Check how many rows match:
SELECT a.dataid, x.Value
FROM TableA a
CROSS APPLY (
SELECT TOP 1 t.Value
FROM #tmpcopylibrary t
WHERE t.dataid = a.dataid
ORDER BY (SELECT NULL)
) x
July 24, 2014 at 2:11 am
TomThomson (7/23/2014)
Brandie Tarvin (7/23/2014)
ChrisM@Work (7/23/2014)
At a guess, you have 741 duplicated rows, 73 triplicated, and 1 quadruplicated.Give the man a cookie for doing the actual math work! 😀
No, he didn't...
July 23, 2014 at 8:31 am
At a guess, you have 741 duplicated rows, 73 triplicated, and 1 quadruplicated.
July 23, 2014 at 6:41 am
-- Some alternative date arithmetic
SELECT
o.Forecasted_Commencement_Renewal_Date__c,
CAST(RTRIM(CAST(MONTH(DATEADD(mm, 1, o.Forecasted_Commencement_Renewal_Date__c)) AS CHAR(2))) + '/01/' + CAST(YEAR(o.Forecasted_Commencement_Renewal_Date__c) AS CHAR(4)) AS DATETIME),
DATEADD(MONTH,DATEDIFF(MONTH,0,Forecasted_Commencement_Renewal_Date__c)+1,0),
CAST((CAST(YEAR(GETDATE()) AS CHAR(4)) + CASE WHEN LEN(CAST(MONTH(GETDATE()) AS CHAR(2))) < 2 THEN...
July 23, 2014 at 5:57 am
wBob (7/23/2014)
July 23, 2014 at 5:37 am
Your first post shows Q1 and Q2 to be identical. If they are not, and you're obfuscating the code, then:
1. Why are you expecting them to execute in the same...
July 23, 2014 at 5:08 am
Lynn Pettis (7/22/2014)
ChrisM@home (7/22/2014)
@wBob, you might find a TOP() -limited IBG-style inline tally even more efficient.
Sort of like this:
IF OBJECT_ID('dbo.numbers') IS NULL
BEGIN
CREATE TABLE dbo.numbers ( x INT, CONSTRAINT PK_numbers PRIMARY...
July 23, 2014 at 4:29 am
murnilim9 (7/22/2014)
ChrisM@Work (7/22/2014)
-- 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...
July 23, 2014 at 1:54 am
-- Make some sample data
DROP TABLE #SampleTable
SELECT *
INTO #SampleTable
FROM (
SELECT TOP 17 [Claim number] = 111, [sequence number] = ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) FROM SYSCOLUMNS
UNION ALL
SELECT TOP 38 [Claim...
July 22, 2014 at 8:25 am
Viewing 15 posts - 3,076 through 3,090 (of 10,144 total)