Viewing 15 posts - 1,561 through 1,575 (of 6,036 total)
What about the other tables in the query?
What indexes do they have?
Are there any FK constraints between these tables?
_____________
Code for TallyGenerator
March 16, 2016 at 9:32 pm
Jeff Moden (3/16/2016)
Lynn Pettis (8/6/2012)
An empty string is not null, it is a known value (empty).
I strongly agree. NULL is not NOTHING. NOTHING is a known...
_____________
Code for TallyGenerator
March 16, 2016 at 9:01 pm
RV16 (3/16/2016)
So I just used that way:
And now its solved. So I just put answer anyone...
_____________
Code for TallyGenerator
March 16, 2016 at 5:26 pm
When deciding on changing the data types take into consideration that same operations (say, WHERE DateCol1 = DateCol2) take 2-3 time longer on DATETIME2 than on DATETIME.
Do it only where...
_____________
Code for TallyGenerator
March 16, 2016 at 5:21 pm
The query may be greatly simplified.
You just need to start from another end.
Do not turn birthday to ages, turn predefined ages into date ranges for birthdays:
SELECT DATEADD(yy, DATEDIFF(yy, 0, GETDATE())-6,...
_____________
Code for TallyGenerator
March 16, 2016 at 5:12 pm
DiabloSlayer (3/14/2016)
Hello Friends,I have a challenging problem to solve !
Not that challenging, really.
Just take each requirement 1 by 1 and put it in SQL.
1. If an employee has an schedule...
_____________
Code for TallyGenerator
March 14, 2016 at 6:29 pm
As for me, there are 2 many words for such a simple operation.
This should do:
INSERT INTO [Clock] ([clockIn], [UserName])
VALUES(GetDate(), 'Rose')
WHERE NOT EXISTS (
SELECT * FROM [Clock] WHERE [clockIn] ='12/03/2016'
AND...
_____________
Code for TallyGenerator
March 13, 2016 at 10:10 pm
For such occasions I've built a script which checks if TRN log files are filled for >50% and launches corresponding BACKUP LOG jobs when required.
Those jobs may included into replication...
_____________
Code for TallyGenerator
March 13, 2016 at 5:43 pm
When saving the script from SSMS make sure you choose UNICODE encoding.
_____________
Code for TallyGenerator
March 10, 2016 at 7:22 pm
Is the described behaviour version dependent?
I replicated the tables, enforced and checked the FK, and I still have Clustered Index Scan on Projects, Clustered Index Seek on Departments and Nested...
_____________
Code for TallyGenerator
March 9, 2016 at 10:40 pm
I'm glad you have no comments on this statement:
MMartin1 (1/21/2016)
_____________
Code for TallyGenerator
March 9, 2016 at 10:16 pm
Ncage (3/9/2016)
Order(OrderId)OrderDetail(OrderDetailId,OrderId).
OrderDetail ClusteredIndex(OrderId)
Probably the most common select criteria will be something similar to:
Select ....
From OrderDetail
Where OrderId = @OrderId
There is a missing piece in your example:
Select ....
From OrderDetail
Where OrderId = @OrderId
ORDER...
_____________
Code for TallyGenerator
March 9, 2016 at 4:13 pm
Mvs2k11 (3/8/2016)
What is the solution.. when I put max recursion to...
_____________
Code for TallyGenerator
March 8, 2016 at 6:05 pm
You can add a computed column to the table and then index it.
_____________
Code for TallyGenerator
March 8, 2016 at 5:53 pm
Igor Micev (3/7/2016)
but it's not clear what he exactly needs.
It's always the story about those "simple questions".
🙂
_____________
Code for TallyGenerator
March 7, 2016 at 7:15 pm
Viewing 15 posts - 1,561 through 1,575 (of 6,036 total)