Viewing 15 posts - 1,966 through 1,980 (of 10,144 total)
Steve Holle (10/30/2015)
When I know a null is a possibility I always use "where isnull(x,'') = ''"
I very rarely use it since it's a non-SARGable predicate and could destroy performance,...
October 30, 2015 at 10:03 am
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...
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?
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)
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)
October 30, 2015 at 7:01 am
Resender (10/30/2015)
October 30, 2015 at 5:04 am
Steve Hurst (10/30/2015)
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,...
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] -...
October 29, 2015 at 11:20 am
Luis Cazares (10/29/2015)
g.britton (10/29/2015)
October 29, 2015 at 10:31 am
J Livingston SQL (10/29/2015)
Bruceo (10/29/2015)
Is that an image...
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...
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...
October 29, 2015 at 8:14 am
You're welcome, thanks for the feedback.
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...
October 29, 2015 at 7:01 am
Viewing 15 posts - 1,966 through 1,980 (of 10,144 total)