Viewing 7 posts - 1 through 8 (of 8 total)
Thanks Lowell. Made the change, only I used DateAdd instead of DateDiff. Appreciate the advice.
June 14, 2013 at 12:27 pm
OK, first thanks to everyone for helping.
I figured out the issue and for anyone who cares here is the problem and here is the solution.
The problem was in the "cteTrainings",...
June 14, 2013 at 11:34 am
Something that might help troubleshoot. If I change the where clause to something that is NOT in the table, for example WHERE TopicCode>20.0, then the query runs INSTANTLY (much...
June 14, 2013 at 11:03 am
I've found the first place the error occurs, so I've substantially simplified the query. If someone can tell me how to attach a file, I can get a new...
June 14, 2013 at 10:54 am
I can't seem to attach a file to a post. All I see is the hyperlink option.
June 14, 2013 at 10:51 am
Here's the execution plan in XML
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1" Build="10.50.1617.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
...
June 14, 2013 at 9:45 am
Here's the query. It's the very end that causes the problem
DECLARE @sdate AS DATE
DECLARE @progfk AS INT
SET @progfk=1
SET @sdate = '01/01/2009'
SET NOCOUNT ON;
;WITH cteMain AS (
SELECT g.WorkerPK, g.WrkrLName
,...
June 14, 2013 at 9:35 am
Viewing 7 posts - 1 through 8 (of 8 total)