Viewing 15 posts - 1,966 through 1,980 (of 10,143 total)
Too many errors. Avoid writing too much at once without testing.
DROP TABLE #table_1;CREATE TABLE #table_1 (StatementName VARCHAR(500))
INSERT INTO #table_1 (StatementName) VALUES ('Nothing')
DROP TABLE #table_3;CREATE TABLE #table_3 (StatementName VARCHAR(500), Flag CHAR(1))
DECLARE...
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
October 30, 2015 at 8:50 am
You have this index definition in your first post:
CREATE NONCLUSTERED INDEX IX_Large_Table_ABDFHJ ON dbo.Large_Table
(A,B,D,F,H,J) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
Why?
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
October 30, 2015 at 8:37 am
ben.brugman (10/30/2015)
Can SQL-server use an index and then use the covering index to collect the data?
(And therefore not using the 'main' table).
Answers:
GilaMonster (10/29/2015)
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
October 30, 2015 at 7:32 am
Eirikur Eiriksson (9/14/2015)
Wayne West (9/14/2015)
Matt Miller (#4) (9/14/2015)
Eirikur Eiriksson (9/14/2015)
Jeff Moden (9/14/2015)
Eirikur Eiriksson (9/13/2015)
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
October 30, 2015 at 7:01 am
Resender (10/30/2015)
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
October 30, 2015 at 5:04 am
Steve Hurst (10/30/2015)
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
October 30, 2015 at 3:55 am
Do you mean like this?
Select Top(10) HotelName, Price, CustomerRating
From dbo.VacationDestinations
where Price <= @price AND CustomerRating = @CustomerRating
Order By
CASE WHEN @ratingWeight >= @priceWeight THEN CustomerRating ELSE Price END DESC,...
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
October 30, 2015 at 2:54 am
A change to the earlier query after mixing up some more data:
SELECT
DeductionID, DeductionAmount, --d.[from], d.[to],
PaymentID, PaymentAmount, --p.[from], p.[to],
DeductionBalance = CASE WHEN d.[to] > p.[to] THEN d.[to] -...
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
October 29, 2015 at 11:20 am
Luis Cazares (10/29/2015)
g.britton (10/29/2015)
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
October 29, 2015 at 10:31 am
J Livingston SQL (10/29/2015)
Bruceo (10/29/2015)
Is that an image...
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
October 29, 2015 at 10:26 am
Ed Wagner (10/29/2015)
yb751 (10/29/2015)
I was thinking about unleashing it but then I thought...
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
October 29, 2015 at 9:06 am
J Livingston SQL (10/29/2015)
ChrisM@Work (10/29/2015)
-- Set up sample data
DECLARE @Deductions TABLE (DeductionID int IDENTITY(1,1),DeductionAmount money);
INSERT @Deductions (DeductionAmount) VALUES (1000),(200),(50),(600);
DECLARE @Payments TABLE...
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
October 29, 2015 at 8:14 am
You're welcome, thanks for the feedback.
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
October 29, 2015 at 7:38 am
Try this - the result of some fiddling around earlier:
-- Set up sample data
DECLARE @Deductions TABLE (DeductionID int IDENTITY(1,1),DeductionAmount money);
INSERT @Deductions (DeductionAmount) VALUES (1000),(200),(50),(600);
DECLARE @Payments TABLE (PaymentID int IDENTITY(1,1),PaymentAmount money);
INSERT...
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
October 29, 2015 at 7:01 am
dramaqueen (10/29/2015)
I am still getting the error
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.
The data in A.Value is a VARCHAR and contains Y,...
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
October 29, 2015 at 6:26 am
Viewing 15 posts - 1,966 through 1,980 (of 10,143 total)