Viewing 15 posts - 5,101 through 5,115 (of 10,143 total)
b ghanekar (3/6/2013)
I think the window functions should be of help here.Please repost the data I am not able to get the data you have posted.
The fourth post on this...
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
March 6, 2013 at 1:36 am
geert.de.vylder (3/5/2013)
... if the rows are null they are repeated several times....
There will be many many rows in the matrix table which don't have a matching ticket, hence null values...
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
March 6, 2013 at 1:32 am
jshahan (3/5/2013)
DECLARE @X TINYINT = 0
;WITH SampleTable AS (
SELECT SOMECOLUMNS = 'SOMECOLUMNS', COLUMN1 = 'COLUMN1', COLUMN2 = 'COLUMN2', COLUMN3 = 'COLUMN3',
COLUMN4 = 'COLUMN4', COLUMN5 = 'COLUMN5', COLUMN6 = 'COLUMN6'
)
SELECT SOMECOLUMNS,...
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
March 6, 2013 at 1:04 am
Deepthy (3/5/2013)
Thanks for the update.But joins in the 3 update statements are different.
Not sure of a way to bind them into one statement.
Deepthy
You got me.
Try this:
UPDATE dbo.DatasiteConfigBMPANConfiguration SET
EnergisationStatus =...
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
March 5, 2013 at 8:55 am
PiMané (3/5/2013)
Is SQL Sentry Plan more accurate than the Execution Plan from SSMS?!I ask this cause in SSMS the TVF is better but in Sentry Plan iTVF is much better...
Thanks,
Pedro
You...
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
March 5, 2013 at 8:21 am
UPDATE d SET
EnergisationStatus = CASE
WHEN c.DataSiteConfigATableName = 'DataSiteConfigAEnergisationStatus' THEN b.EnergisationStatus
ELSE EnergisationStatus END,
MeasurementClassRef = CASE
WHEN c.DataSiteConfigATableName = 'DataSiteConfigAMeasurementClass' THEN b.measurementClassRef
ELSE MeasurementClassRef END,
ProfileClass = CASE
WHEN c.DataSiteConfigATableName = 'DataSiteConfigAProfileClass' THEN b.ProfileClass
ELSE...
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
March 5, 2013 at 8:19 am
PiMané (3/5/2013)
ChrisM@Work (3/5/2013)
UPDATE AcumuladosContas SET MES12DB = MES12DB + 5000.00
FROM dbo.GetSubContasTVF('111') t
WHERE TipoLancamento = '000' AND Ano = 2012 AND Moeda = 'EUR'
AND...
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
March 5, 2013 at 8:00 am
You should avoid this syntax:
UPDATE AcumuladosContas SET MES12DB = MES12DB + 5000.00
FROM dbo.GetSubContasTVF('111') t
WHERE TipoLancamento = '000' AND Ano = 2012 AND Moeda = 'EUR'
AND Conta =...
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
March 5, 2013 at 7:48 am
You can't compare queries like this - you have to time them using a realistically-sized data set. "% of the batch" is 100% unreliable.
If a function contains a BEGIN/END block...
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
March 5, 2013 at 7:09 am
chingarova (3/5/2013)
ok, lets say that the script look like this:
It's an improvement in that you now have a "key" (not ideal - not everybody has an email address, many folks...
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
March 5, 2013 at 6:18 am
Try using a proper iTVF, the performance will be far better:
ALTER FUNCTION [dbo].[GetSubContasTVF](@Conta NVARCHAR(20))
RETURNS TABLE
AS
RETURN SELECT SUBSTRING(@Conta, ID, LEN(@Conta)) SubConta FROM PriTally WHERE ID BETWEEN 1 AND LEN(@Conta) -...
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
March 5, 2013 at 5:59 am
winmansoft (3/5/2013)
ChrisM@Work (3/5/2013)
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
March 5, 2013 at 5:11 am
cms9651 (3/5/2013)
Extract only the last three days
Anything from saturday+sunday+monday, or anything since 72 hours ago from now?
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
March 5, 2013 at 4:49 am
Gazareth (3/5/2013)
I think Chris's solution is the way to go unless you find it's not what you need or...
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
March 5, 2013 at 4:14 am
prakashr.r7 (3/5/2013)
You can solve your immeditate problem by using the solution I proposed above - generate a table of all 36 values (or whatever) randomised relative to an incrementing numeric...
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
March 5, 2013 at 4:07 am
Viewing 15 posts - 5,101 through 5,115 (of 10,143 total)