| Author |
Topic |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-27 : 07:09:14
|
After installing SP2 for SQL Serve 2005, I get strange errors when using either "Estimated Execution Plan" or "Actual Execution Plan".Using "Estimated Execution Plan" generates this errorAn error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 3998).Unexpected end of file while parsing has occurred. Line 1, position 3998.Using "Actual Execution Plan" generates this errorAn error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 4001).Unexpected end of file has occurred. The following elements are not closed: RelOp, ComputeScalar, RelOp, Update, RelOp, QueryPlan, StmtSimple, Statements, Batch, BatchSequence, ShowPlanXML. Line 1, position 4001.All I do is testing this solutiondeclare @t table (dt datetime)insert @tselect '02-Jan-2007' union allselect '01-Feb-2007' union allselect '10-Feb-2007' union allselect '28-Feb-2007' union allselect '18-Mar-2007'DECLARE @DaysRange INT, @NumOfCalls INTSELECT @DaysRange = 35, @NumOfCalls = 4SELECT t1.dt AS theDateFROM @t AS t1CROSS JOIN @t AS t2WHERE t2.dt >= DATEADD(day, DATEDIFF(day, 0, t1.dt), 0) AND t2.dt < DATEADD(day, DATEDIFF(day, 0, t1.dt), @DaysRange) OR t2.dt >= DATEADD(day, DATEDIFF(day, @DaysRange, t1.dt), 1) AND t2.dt < DATEADD(day, DATEDIFF(day, 0, t1.dt), 1)GROUP BY t1.dtHAVING COUNT(*) >= @NumOfCalls Has anyone else experienced this?Peter LarssonHelsingborg, Sweden |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2007-02-27 : 07:56:12
|
| maybe direct to members PaulRandal or Mikewa...both work within Microsoft. |
 |
|
|
paulrandal
Yak with Vast SQL Skills
899 Posts |
Posted - 2007-02-27 : 10:05:29
|
| I've forwarded this to the dev team...Paul RandalPrincipal Lead Program Manager, Microsoft SQL Server Core Storage Engine(Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)http://blogs.msdn.com/sqlserverstorageengine/default.aspx |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-27 : 12:37:41
|
| Thank you.Now I get this result when using "Estimated Execution Plan" for same query as aboveAn error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 4001).There is an unclosed literal string. Line 1, position 4001.And this error when using "Actual Execution Plan"An error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 4001).Unexpected end of file while parsing Name has occurred. Line 1, position 4001.I have not restarted SQL 2005 service since last error message, neither have I restarted SSMS. I have not closed the query window either. The only difference is that I emptied the query window and copied and pasted the query posted above.Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-05 : 05:57:19
|
Today, when testing these solutions-- Prepare sample dataset dateformat mdydeclare @process table (caseid int, processid int, procstartdate datetime, procenddate datetime)insert @processselect 10, 1, '02-28-2005', '06-17-2005' union allselect 10, 2, '06-18-2005', '07-21-2005' union all select 10, 3, '07-22-2005', '10-11-2005' union allselect 20, 1, '03-21-2005', '07-24-2005' union allselect 20, 2, '07-25-2005', '08-10-2005'declare @letters table (caseid int, letterlogid int, entrydate datetime, amtofletters int)insert @lettersselect 10, 101, '04-15-2005', 1 union allselect 10, 102, '07-20-2005', 1 union allselect 10, 103, '09-16-2005', 1 union allselect 20, 201, '06-14-2005', 1 union allselect 20, 202, '06-19-2005', 1 union allselect 20, 203, '07-27-2005', 1 union allselect 20, 204, '07-29-2005', 1declare @phonecalls table (caseid int, phonelogid int, entrydate datetime, amtofphonecalls int)insert @phonecallsselect 10, 4101, '04-17-2005', 1 union allselect 10, 4102, '07-24-2005', 1 union allselect 10, 4103, '09-18-2005', 1 union allselect 10, 4104, '09-23-2005', 1 union allselect 10, 4105, '09-25-2005', 1 union allselect 20, 4106, '06-18-2005', 1 union allselect 20, 4107, '06-20-2005', 1 union allselect 20, 4108, '07-28-2005', 1 union allselect 20, 4109, '07-29-2005', 1 -- First try, INNER JOINs on LEFT JOINs GROUP BYsSELECT x.CaseID, x.ProcessID, ISNULL(x.AmtOfLetters, 0) AS AmtOfLetters, ISNULL(y.AmtOfPhoneCalls, 0) AS AmtOfPhoneCallsFROM ( SELECT p.CaseID, p.ProcessID, SUM(l.AmtOfLetters) AS AmtOfLetters FROM @Process AS p LEFT JOIN @Letters AS l ON l.CaseID = p.CaseID AND l.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate GROUP BY p.CaseID, p.ProcessID ) AS xINNER JOIN ( SELECT p.CaseID, p.ProcessID, SUM(c.AmtOfPhoneCalls) AS AmtOfPhoneCalls FROM @Process AS p LEFT JOIN @PhoneCalls AS c ON c.CaseID = p.CaseID AND c.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate GROUP BY p.CaseID, p.ProcessID ) AS y ON y.CaseID = x.CaseID AND y.ProcessID = x.ProcessIDORDER BY x.CaseID, x.ProcessID-- Second try, INNER JOINs on UNIONsSELECT CaseID, ProcessID, SUM(AmtOfLetters) AS AmtOfLetters, SUM(AmfOfPhoneCalls) AS AmfOfPhoneCallsFROM ( SELECT p.CaseID, p.ProcessID, l.AmtOfLetters, 0 AS AmfOfPhoneCalls FROM @Process AS p INNER JOIN @Letters AS l ON l.CaseID = p.CaseID AND l.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate UNION ALL SELECT p.CaseID, p.ProcessID, 0, c.AmtOfPhoneCalls FROM @Process AS p INNER JOIN @PhoneCalls AS c ON c.CaseID = p.CaseID AND c.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate UNION ALL SELECT p.CaseID, p.ProcessID, 0, 0 FROM @Process AS p ) AS xGROUP BY CaseID, ProcessIDORDER BY CaseID, ProcessID-- Third try, LEFT JOINs on UNIONsSELECT CaseID, ProcessID, SUM(AmtOfLetters) AS AmtOfLetters, SUM(AmfOfPhoneCalls) AS AmfOfPhoneCallsFROM ( SELECT p.CaseID, p.ProcessID, ISNULL(l.AmtOfLetters, 0) AS AmtOfLetters, 0 AS AmfOfPhoneCalls FROM @Process AS p LEFT JOIN @Letters AS l ON l.CaseID = p.CaseID AND l.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate UNION ALL SELECT p.CaseID, p.ProcessID, 0, ISNULL(c.AmtOfPhoneCalls, 0) FROM @Process AS p LEFT JOIN @PhoneCalls AS c ON c.CaseID = p.CaseID AND c.EntryDate BETWEEN p.ProcStartDate AND p.ProcEndDate ) AS xGROUP BY CaseID, ProcessIDORDER BY CaseID, ProcessID I get these error messages:Estimated Execution PlanAn error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 4001).Unexpected end of file while parsing Name has occurred. Line 1, position 4001.Actual Execution Plan(5 row(s) affected)An error occurred while executing batch. Error message is: Error processing execution plan results. The error message is:There is an error in XML document (1, 4001).Unexpected end of file while parsing Name has occurred. Line 1, position 4001.Peter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-06 : 13:14:52
|
| There seems to be problem with your SQL Server installation, Peter.I ran the same scripts on my machine and it's working fine with both estimated and actual execution plan.I have SQL server 2005 Enterprise sp2 edition running on Windows 2003 SP1.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-06 : 13:45:16
|
| Not all queries does this. The queries above works fine now and I haven't restarted my machine nor SQL service.Happens only to one or two queries, every second or third day.I am using SQL Server 2005 Developer Edition with SP2.OS is Windows XP SP2.Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-06 : 13:47:54
|
| Installation of SQL SP2 went fine without any errors.I only installed Database Enginge. Haven't installed SSIS, SSAS or RS.Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-07 : 06:58:51
|
| Well... That was not a good idea.I uninstalled SQL Server from Control Panel and tried to install SQL Server from scratch.The installation program tells me"Service SQL Server (MSSQLServer) could not be installed. Verify that you have sufficient privileges to install system services".I am logged on a local administrator, and now I have no SQL Server on my laptop!Peter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-07 : 07:13:38
|
| Seems like something wrong with your registry. May be you can try re-installing the OS itself (Arghhhh...!!!).Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|