The Query Processor Ran Out Of Stack Space....Please Simplify The Query.

Oct 9, 2007



I received the following error today while migrating some code from SQL 2000 standard to SQL 2005 standard:

The query processor ran out of stack space during query optimization. Please simplify the query.

From what I gather, this error is usually an indication that one of the SQL Server 2005 maximum capacity specifications has been exceeded. However, I'm not sure which one. The only one that seems suspect is the number of nested subqueries (32), however I believe the numerous subqueries in my query would be classified as correlated rather than nested.

An example of my code is below. It is necessarily messy, as the output needs to be denormalized somewhat. Note that this runs just fine on SQL 2000, and it retrieves the 1500 or so rows of data in about 30 seconds. Thanks in advance for any ideas as to what may be causing this error. (Sorry for not using code-block, but all the html tags it threw in were exceeding the 50,000 character limit for the message)


BEGIN

SELECT

(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 1) AS A5,

(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 2) AS A6,

(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 3) AS A7,

(SELECT Agent FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 4) AS A8,

dbo.f_formatpseudodate(Accrued_Interest_To) AS AI,

dbo.f_getmiscdescription('AM', c.Card_Number, Amended) AS AM,

Basis_Shareblock_1 AS B1,

Basis_Shareblock_2 AS B2,

Basis_Shareblock_3 AS B3,

Basis_Shareblock_4 AS B4,

Basis AS BS,

dbo.f_getmiscdescription('C1', c.Card_Number, Price_Code_1) AS C1,

dbo.f_getmiscdescription('C2', c.Card_Number, Price_Code_2) AS C2,

dbo.f_getmiscdescription('C3', c.Card_Number, Price_Code_3) AS C3,

dbo.f_getmiscdescription('C4', c.Card_Number, Price_Code_4) AS C4,

dbo.f_getmiscdescription('C5', c.Card_Number, Price_Code_5) AS C5,

dbo.f_getmiscdescription('C6', c.Card_Number, Price_Code_6) AS C6,

CAST(Card_Date AS smalldatetime) AS CD,

c.Card_Number AS CN,

dbo.f_getisocurrencycode(Currency_Code) AS CR,

Card_Status AS CS,

dbo.f_formatpseudodate(Record_Date) AS CT,

Currency_Description AS CU,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 1) AS D1,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 2) AS D2,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 3) AS D3,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 4) AS D4,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 5) AS D5,

(SELECT New_Issue_Description FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 6) AS D6,

dbo.f_formatboolean(Dutch_Auction) AS DA,

dbo.f_formatpseudodate(Dated_Date) AS DD,

dbo.f_getmiscdescription('DI', c.Card_Number, Distribution_In) AS DI,

Dealer_Manager_2 AS DL,

Dealer_Manager_1 AS DM,

dbo.f_getmiscdescription('DV', c.Card_Number, Dividend_In) AS DV,

Basis_Surrender_1 AS E1,

Basis_Receive_1_1 AS E2,

Basis_Amount_1_1 AS E3,

Basis_CUSIP_1_1 AS E4,

Basis_Receive_1_2 AS E5,

Basis_Amount_1_2 AS E6,

Basis_CUSIP_1_2 AS E7,

Basis_Receive_1_3 AS E8,

Basis_Amount_1_3 AS E9,

dbo.f_getmiscdescription('EC', c.Card_Number, Record_Date_Code) AS EC,

Equity_Debt AS ED,

dbo.f_getmiscdescription('EF', c.Card_Number, Effective_Date_Code) AS EF,

dbo.f_getmiscdescription('EX', c.Card_Number, Expiration_Date_Code) AS EX,

dbo.f_getmiscdescription('F1', c.Card_Number, Refer_Code_1) AS F1,

dbo.f_getmiscdescription('F2', c.Card_Number, Refer_Code_2) AS F2,

dbo.f_getmiscdescription('F3', c.Card_Number, Refer_Code_3) AS F3,

dbo.f_formatpseudodate(Effective_Date) AS FD,

File_Activity_Type AS FT,

dbo.f_getmiscdescription('G1', c.Card_Number, Rights_Ratio_1) AS G1,

dbo.f_getmiscdescription('G2', c.Card_Number, Rights_Ratio_2) AS G2,

dbo.f_getmiscdescription('G3', c.Card_Number, Rights_Ratio_3) AS G3,

RTRIM(LTRIM(Original_Card_Number)) AS GC,

dbo.f_getmiscdescription('GD', c.Card_Number, Ex_Rights_Date_Code) AS GD,

dbo.f_getmiscdescription('GT', c.Card_Number, Rights_To) AS GT,

Basis_Amount_2_3 AS H1,

Basis_CUSIP_2_3 AS H2,

Basis_Surrender_3 AS H3,

Basis_Receive_3_1 AS H4,

Basis_Amount_3_1 AS H5,

Basis_CUSIP_3_1 AS H6,

Basis_Receive_3_2 AS H7,

Basis_Amount_3_2 AS H8,

Basis_CUSIP_3_2 AS H9,

Information_Agent_1 AS I1,

Information_Agent_2 AS I2,

Interest_Rate AS [IN],

dbo.f_getmiscdescription('J1', c.Card_Number, Subscription_Ratio_Code_1) AS J1,

dbo.f_getmiscdescription('J2', c.Card_Number, Subscription_Ratio_Code_2) AS J2,

dbo.f_getmiscdescription('J3', c.Card_Number, Subscription_Ratio_Code_3) AS J3,

Basis_CUSIP_4_2 AS K1,

Basis_Receive_4_3 AS K2,

Basis_Amount_4_3 AS K3,

Basis_CUSIP_4_3 AS K4,

Basis_Receive_3_3 AS L1,

Basis_Amount_3_3 AS L2,

Basis_CUSIP_3_3 AS L3,

Basis_Surrender_4 AS L4,

Basis_Receive_4_1 AS L5,

Basis_Amount_4_1 AS L6,

Basis_CUSIP_4_1 AS L7,

Basis_Receive_4_2 AS L8,

Basis_Amount_4_2 AS L9,

dbo.f_formatpseudodate(Withdrawal_After) AS LA,

dbo.f_getmiscdescription('LC', c.Card_Number, Withdrawal_After_Code) AS LC,

dbo.f_getmiscdescription('LG', c.Card_Number, Eligibility) AS LG,

Withdrawal_After_Time AS LT,

dbo.f_getmiscdescription('LZ', c.Card_Number, Withdrawal_After_Zone) AS LZ,

Option_Expiration_Time AS M1,

Rights_Expire_Time AS M3,

Expiration_Date_Time AS M4,

dbo.f_formatpseudodate(Maturity_Date) AS MD,

Maximum_Eligibility AS ME,

dbo.f_validatecardnumber(Refer_Card_1) AS N1,

dbo.f_validatecardnumber(Refer_Card_2) AS N2,

dbo.f_validatecardnumber(Refer_Card_3) AS N3,

dbo.f_getmiscdescription('NT', c.Card_Number, Interest_Rate_Code) AS NT,

DTC_Match_Card_Number AS O3,

Offer_By AS OB,

Odd_Lot AS OD,

dbo.f_getmiscdescription('OV', c.Card_Number, OverSubscription) AS OV,

dbo.f_formatpseudodate(Option_Expiration_Date) AS OX,

(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 4) AS P1,

Information_Agent_Telephone_1 AS P2,

Information_Agent_Telephone_2 AS P3,

Dealer_Manager_Telephone_1 AS P4,

Dealer_Manager_Telephone_2 AS P5,

CUSIP_Number AS PN,

dbo.f_formatpseudodate(Pro_Ration_Date) AS PO,

dbo.f_getmiscdescription('PY', c.Card_Number, Payable_To) AS PY,

dbo.f_getmiscdescription('PZ', c.Card_Number, Protect_Period) AS PZ,

Price_1 AS R1,

Price_2 AS R2,

Price_3 AS R3,

Price_4 AS R4,

Price_5 AS R5,

Price_6 AS R6,

dbo.f_getmiscdescription('RB', c.Card_Number, Rights_Transferable) AS RB,

Rights_CUSIP AS RC,

Issuer_Description AS RD,

dbo.f_getmiscdescription('RI', c.Card_Number, Pro_Ration_Date_Code) AS RI,

Record_Type AS RT,

dbo.f_formatpseudodate(Rights_Expire_Date) AS RX,

CAST(Subscription_Ratio_1 AS varchar(12)) + Subscription_Ratio_1_Unit AS S1,

CAST(Subscription_Ratio_2 AS varchar(12)) + Subscription_Ratio_2_Unit AS S2,

CAST(Subscription_Ratio_3 AS varchar(12)) + Subscription_Ratio_3_Unit AS S3,

dbo.f_getmiscdescription('SC', c.Card_Number, Source_Name) AS SC,

Service_Type AS SE,

dbo.f_getmiscdescription('ST', c.Card_Number, Subscription_To) AS ST,

(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 1) AS T2,

(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 2) AS T3,

(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 3) AS T4,

(SELECT Redemption_Agent_Telephone FROM Redemption_Agent ra WHERE ra.Card_Number = c.Card_Number AND Redemption_Agent_Number = 4) AS T5,

(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 1) AS T7,

(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 2) AS T8,

(SELECT Agent_Telephone FROM Agent a WHERE a.Card_Number = c.Card_Number AND Agent_Number = 3) AS T9,

Tickler_Date AS TK,

dbo.f_getmiscdescription('TP', c.Card_Number, To_Purchase) AS TP,

dbo.f_getmiscdescription('TS', c.Card_Number, Transaction_Status) AS TS,

dbo.f_gettxtext(c.Card_Number) AS TX,

Basis_CUSIP_1_3 AS U1,

Basis_Surrender_2 AS U2,

Basis_Receive_2_1 AS U3,

Basis_Amount_2_1 AS U4,

Basis_CUSIP_2_1 AS U5,

Basis_Receive_2_2 AS U6,

Basis_Amount_2_2 AS U7,

Basis_CUSIP_2_2 AS U8,

Basis_Receive_2_3 AS U9,

RTRIM(Issue_Description) AS UD,

Voluntary_Mandatory AS VM,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 1) AS W1,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 2) AS W2,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 3) AS W3,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 4) AS W4,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 5) AS W5,

(SELECT New_Issue_CUSIP FROM New_Issue ni WHERE ni.Card_Number = c.Card_Number AND New_Issue_Number = 6) AS W6,

dbo.f_formatpseudodate(Withdrawal_Prior_To) AS WD,

Withdrawal_Prior_To_Time AS WH,

dbo.f_getmiscdescription('WO', c.Card_Number, Withdrawal_Prior_To_Code) AS WO,

dbo.f_getmiscdescription('WZ', c.Card_Number, Withdrawal_Prior_To_Zone) AS WZ,

(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =3) AS X1,

(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number = 3) AS X2,

dbo.f_formatpseudodate(Expiration_Date) AS XD,

dbo.f_formatpseudodate(Ex_Rights_Date) AS XR,

dbo.f_getmiscdescription('XT', c.Card_Number, Rights_Expire_Code) AS XT,

Payable_Rate_Shareblock AS Y1,

Payable_Rate_Surrender AS Y2,

(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y3,

(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y4,

(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =1) AS Y5,

(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y6,

(SELECT Payable_Rate_Amount FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y7,

(SELECT Payable_Rate_CUSIP FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =2) AS Y8,

(SELECT Payable_Rate_Receive FROM Payable_Rate pr WHERE pr.Card_Number = c.Card_Number AND Payable_Rate_Number =3) AS Y9,

dbo.f_formatpseudodate(Payment_Date) AS YD,

dbo.f_getmiscdescription('YR', c.Card_Number, Payable_Rate) AS YR,

dbo.f_getmiscdescription('Z1', c.Card_Number, Option_Expiration_Zone) AS Z1,

Rights_Expire_Zone AS Z3,

Expiration_Date_Zone AS Z4

FROM COMMON c

INNER JOIN DC_DailyCard dc ON c.Card_Number = dc.Card_Number

WHERE c.Card_Status = 'R' AND c.Card_Date BETWEEN @start_date AND @end_date

END

View 2 Replies


ADVERTISEMENT

Query Optimisor Out Of Stack Space

Oct 4, 2006

Hi,

I have recently upgraded to SQL Server 2005 (SP1) Developer Edition from SQL Server 2000 (SP4). Since doing so, i have been unable to delete any records from a specific table.

I have found this is due to having approximately 340 foreign key constraints referencing the UserID column of the table.

This functionality worked in SQL Server 2000. Do Microsoft plan to release any fixes for this issue?

Kind Regards,
Martyn...

View 4 Replies View Related

Error: 8624 Internal Query Processor Error: The Query Processor Could Not Produce A Query Plan.

May 24, 2007

SQL Server 2005 9.0.3161 on Win 2k3 R2



I receive the following error:



"Error: 8624, Severity: 16, State: 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."



I have traced this to an insert statement that executes as part of a stored procedure.



INSERT INTO ledger (journal__id, account__id,account_recv_info__id,amount)

VALUES (@journal_id, @acct_id, @acct_recv_id, @amount)



There is also an auto-increment column called id. There are FK contraints on all of the columns ending in "__id". I have found that if I remove the contraint on account__id the procedure will execute without error. None of the other constraints seem to make a difference. Of course I don't want to remove this key because it is important to the database integrity and should not be causing problems, but apparently it confuses the optimizer.



Also, the strange thing is that I can get the procedure to execute without error when I run it directly through management studio, but I receive the error when executing from .NET code or anything using ODBC (Access).

View 5 Replies View Related

Internal Query Processor Error: The Query Processor Encountered An Unexpected Error During Execution.

Nov 26, 2007



I am running a query on a SQL Server 2005 database and encounter the following error message


"Internal Query Processor Error: The query processor encountered an unexpected error during execution."

There is a join between a table on the 2005 database and another on a 2000 database. I have run DBCC CHECKTABLE and found no errors on the two tables.

Anybody with ideas?

Thanks

View 3 Replies View Related

Simplify SQL Query

May 27, 2008

Hi all, anyway to simplify this?



SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '1' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule1 = 1
UNION
SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '2' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule2 = 1
UNION
SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '3' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule3 = 1
UNION
SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '4' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule4 = 1
UNION
SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '5A' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule5A = 1
UNION
SELECT DISTINCT Code_Name, Code_Desc, Code_Reaction_Guide FROM dbo.tbl_ref_OutgoingQA_Control_Limits l, dbo.tbl_ref_SPC_Rules_Code r, dbo.tbl_ref_OutgoingQA_Chart_Type c
WHERE r.Code_Area = 'A' AND r.Test_Type = 'B' AND r.Code_Mode = 'C'
AND r.Code_Name = '5B' AND l.Chart_Type_ID = c.Chart_Type_ID AND l.Test_Type = c.Test_Type AND l.Rule5B = 1

View 1 Replies View Related

Simplify (and Correct) A Query

Mar 2, 2006

I’ve got a table called tblApplicant_Details with the following fields - Applicant_ID, Application_ID, Net_Income, Loans.

In this table I’ve got a list of people and their income details (Net_Income) and expenses (loans). In some cases there will be 2 applicants with the same application_ID.

What I need to do is select one applicant (Applicant_ID) per application (Application_ID). In the case of 2 applicants for an application, I need to select the person with the highest income (net_income - loans), if both of the applicants have the same income I want the one with the lowest Applicant_ID and if only one person applies then that person.

Below is the code I’ve been using. I’ve noticed that its not always selecting an applicant for each application. I know it’s also very long for what I am trying to do but I was hoping someone would be able to tell me how I can fix it and tidy it up a bit.

SELECT Application_ID, MIN(Applicant_ID) AS Applicant_ID
FROM (SELECT DERIVEDTBL.Application_ID, dbo.tblAPPLICANT_DETAILS.Applicant_ID
FROM (SELECT MAX(APPLICANT.Net_Income - APPLICANT.Loans) AS Income, APPLICATION.Application_ID
FROM dbo.tblAPPLICANT_DETAILS APPLICANT INNER JOIN
dbo.tblAPPLICATION_DETAILS APPLICATION ON APPLICANT.Application_ID = APPLICATION.Application_ID
GROUP BY APPLICATION.Application_ID) DERIVEDTBL INNER JOIN
dbo.tblAPPLICANT_DETAILS ON DERIVEDTBL.Application_ID = dbo.tblAPPLICANT_DETAILS.Application_ID AND
DERIVEDTBL.Income = dbo.tblAPPLICANT_DETAILS.Net_Income - Loans) DERIVEDTBL
GROUP BY Application_ID

Thanks

View 3 Replies View Related

How To Simplify My Endless Query. Thanks.

Jul 23, 2005

Hello group!I am having a problem with simplying my query...I would like to get customers' balance info based on how many monthssince they opened their accounts. The tricky part here is accountsstarting with '28' are treated differently than other accounts, theyare given 3 months grace period. In other words, for all otheraccounts, their month0 balance is the balance of their open_month, andmonth1 balance is the balance after the account is opened 1 month, andso on. But accounts starting with '28' month0 balance would be thebalance after the account is opened 3 months, and month1 balance wouldbe the balance after the account is opened 4 months, and so on.My query below works, but since some customers are more than 10 yearsold (more than 120 months), my query is endless! Does anyone know abetter way to do the same job? Many thanks!create table a(person_id int,account int,open_date datetime)insert into a values(1,200001,'11/15/2004')insert into a values(2,280001,'8/20/2004')create table b(account int,balance_date datetime,balance money)insert into b values(200001,'11/30/2004',700)insert into b values(200001,'12/31/2004',800)insert into b values(200001,'1/31/2005',900)insert into b values(200001,'2/28/2005',1000)insert into b values(280001,'8/30/2004',7000)insert into b values(280001,'9/30/2004',8000)insert into b values(280001,'10/31/2004',9000)insert into b values(280001,'11/30/2004',10000)insert into b values(280001,'12/31/2004',15000)insert into b values(280001,'1/31/2005',20000)insert into b values(280001,'2/28/2005',30000)--Ideal output--person_idacc_nomonth0_balancemonth1_balancemonth2_balancemonth3_balance1200000170080090010002280000110000150002000030000select a.person_id,a.account,month0_balance=casewhen a.account like '2%' and a.account not like '28%'thensum(case datediff(mm, a.open_date, balance_date) when 0then b.balance else 0 end)else sum(case datediff(mm, a.open_date, balance_date)when 3 then b.balance else 0 end)end,month1_balance =casewhen a.account like '2%' and a.account not like '28%'thensum(case datediff(mm, a.open_date, balance_date) when 1then b.balance else 0 end)else sum(case datediff(mm, a.open_date, balance_date)when 4 then b.balance else 0 end)endfrom a as ajoin b as bon a.account=b.accountgroup by a.person_id, a.account

View 3 Replies View Related

Master Data Services :: Error - Query Processor Could Not Produce A Query Plan

Jul 19, 2015

We have a issue with a MDS server that have been over us for a couple of days, the original error msg from SQL Server Engine is the one "The query processor could not produce a query plan" but the ones we get on the Excel-Addin are "Sequece contains no elements" or "The value cannot be null" T

• Using Microsoft SQL Server 2012 (SP1) - 11.0.3393.0 (X64) for 6months on this server without issues

• Two weeks ago we started to have 2 errors: "Sequence Contains No Elements" | "The Value Cannot Be Null"

• We are using the last version of Excel Add-in

• We try to reinstall the MDS feature

• If I backup/restore MDS database to other server it works

• We updated to SQL 2012 SP2 + CU4 but the error persisted ...

Looking at the MDSTraceLog we are routed to the this msg

SQL Error Debug Info: Number: 8624, Message: Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services., Server: bbdvsql03inst01, Proc: udpMetadataEntityGetDetailsXML, Line: 28

At line 28 udpMetadataEntityGetDetailsXML is calling udfMetadataEntityGetDetailsXML … and here is where we stopped

** Error found when try to get data from a entity using Excel add-in **
===================================
Sequence contains no elements
------------------------------
Program Location:
   at Microsoft.MasterDataServices.AsyncEssentials.AsyncResultBase.EndInvoke()
   at Microsoft.MasterDataServices.ExcelAddInCore.AsyncProviderBase`1.EndOperation(IAsyncResult ar)

[code]....

View 3 Replies View Related

SQL 2005 V9.0.2047 (SP1) - The Query Processor Could Not Produce A Query Plan

May 15, 2006

Hi Everyone:

*Before* I actually call up Microsoft SQL Customer Support Services and ask them, I wanted to ping other people to see if you have ever ran into this exact error

"Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."

I would have searched the forums myself, but at this moment in time, search is broken :(

If anyone has run into this error before, what conditions would exist that this could happen? That is, if I can sniff this out with suggestions from the community, I would be happy to do so.

It is an oddity because if I alter a couple subqueries in the where clause [ i.e., where tab.Col = (select val from tab2 where id='122') ]to not have subqueries [hand coded values], then the t-sql result is fine. It's not as if subqueries are oddities... I've used them when appropriate.

fwiw - Not a newbie t-sql guy. ISV working almost daily with t-sql since MS SQL 2000. I have never seen this message before...at least I don't recall ever seeing it.

Thanks in advance for other suggested examination paths.

View 10 Replies View Related

Internal Query Processor Error

Mar 31, 2008

Hi,I am trying to execute rather complex query, and I got query processorerror. I read the Microsoft support page and it said I should install SP4,and I did, but the error is still there.I am running MSDE with SP4 installed. Everything else works like a charm.Zvonko

View 1 Replies View Related

The Query Processor Ran Out Of Internal Resources

Oct 17, 2006

Hi,

I have MS SQL Express installed on my local machine and I have problems runnig some unit tests. Precisely, an exception is thrown as follows:

System.Data.SqlClient.SqlException : The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

Nevertheless, everythin is ok on the server, where MS SQL Developer Edition is installed.

What can be the reason for such behavior?

View 1 Replies View Related

Internal Query Processor Error

Jan 15, 2008

Hi All,

I am hoping somebody can help with this. I have searched other posts and it seems like my problem should have been fixed with the hotfix but it wasn't. I am using SQL Express (SQL Server 9.0.3161) and have been using this database for quite some time and have never experienced this problem till yesterday. I am getting the error message "Internal Query Process Error: The query processor could not produce a query plan." This error appears when trying to add a new record to a table either when using a form through a MS Access front-end or when entering data directly into a table using MS SQL Server Managemnet Studio Express. It happens on different tables but not all tables. If I run a INSERT INTO query I can add data to the table. At the same time this has happened, when I run some of my stored procedures I get the same error.

This morning I installed the Cumulative Update Package (build3161) for SQL Server Service Pack 2, KB# 935356 and it didn't make any differance. I have attached the database to another SQL server (9.0.3042) and it did the same thing. This leads me to believe that the problem may be in the database itself. But I can't for the life of me figure out where to start as the database was working fine when used the day before and no changes had been made to the structure of it recently. Can anybody tell me what I should be looking for or where the problem might be?

Ernie

View 1 Replies View Related

Internal Query Processor Error

Nov 9, 2007

Ok, I'm getting an issue with SQL Server and I'm at a bit of a loss to understand why it's happening.

Situation: We have an existing database, and we're running a migration script over it to bring it up to a new version.

We get partway through the script when we get the error:
Internal Query Processor Error: The query processor ran out of stack space during query optimization.

I've searched around the web and it seems that people get this when they do silly things like have 300 Foreign Keys, or 17 pages of where clauses, or something else rediculous to hit the boundary conditions of SQL Server.

this is what i've gathered so far about our situation, using SQL Server 2000 SP4
1. I've recreated/changed a clustered index using the drop_existing clause
/****** Object: Index [IX_BM_SYNCHRONIZATION_1] Script Date: 08/28/2007 18:42:11 ******/
CREATE CLUSTERED INDEX [IX_BLAH ON [dbo].[TABLE_BLAH]
(
[VECTORID] ASC,
[TRANSID] ASC,
[ORDERID] ASC
)
WITH DROP_EXISTING
GO

2. later on the script, we attempt to delete from this table with a query that doesn't use this index eg
DELETE FROM TABLE_BLAH WHERE PRODUCT_NAME = 'blah'

and we get the error: Internal Query Processor Error: The query processor ran out of stack space during query optimization.

We're running this through osql.exe and not using any transactions

likewise, there is another section where it tries to insert into this table and it gets the same error.


Does anyone have an idea of what we could be running into here - the table only has 3 indexes on it, has only 18 columns (of which one is a 'text' column) and the particular datbase we're running this on is tiny.

Thanks,

View 1 Replies View Related

Random Internal Query Processor Error

Aug 24, 2007

Application folks experiencing recurrence of problem previously reported. This is causing delays with multiple projects. Errors below are occuring when attempting to run a DTS package that will refresh data from prod to pilot.

Exception Details: System.Data.SqlClient.SqlException: Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Another example reads:
Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:The task reported failure on execution. (Microsoft OLE DB Provider for SQL Server (80004005): Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.)
Step Error code: 8004043B
Step Error Help Fileqldts80.hlp
Step Error Help Context ID:1100

View 1 Replies View Related

SQL Server 2005 Error 8630: Internal Query Processor Error

Jan 22, 2007

I have a SProc that runs across many clients without any problems. Every now and then, though, I get the following error:

Internal Query Processor Error: The query processor encountered an unexpected error during execution. [SQLSTATE 42000] (Error 8630).

All I am doing is populating Temp tables with some data and then joining them together to create a Global Temp table that is being BCP'd to a network share.

Has anyone come across this error in SQL Server 2005? I cannot find anything on Google or Microcsoft.

Thanks,
Robert

View 1 Replies View Related

SQL Server 7 Error 8630 - Internal Query Processor Error

Mar 15, 2004

Has anyone come across error 8630 "Internal Query Processor Error: The query processor encountered an unexpected error during execution." with SQL Server 7 with SP4 installed?

There are microsoft articles on the error, but the errors are suposidly fixed in SQL Server 7 SP2 and SP3.

We are selecting from one view left outer joined with another, but no unions are involved.

This is not a problem in SQL Server 2000, but unfortunatlely Microsoft are supporting SQL Server 7 until 2005 and so we have to do the same...

View 4 Replies View Related

SQL Query Blank Space

Oct 11, 2000

Hi:
I did the following query on SQL Server A and got the following result.
Input: select replace('10/10/00', '/', '')
Result: 101000
(1 row(s) affected)
However, I did the same query on SQL B and got a different result.
Input: select replace('10/10/00', '/', '')
Output: 10 10 00
(1 row(s) affected)

Both Servers are SQL 7.0 with SP2. I checked the setting, it seems to be identical. Does anyone know what could be the problem or have any hint what I need to check?
I beleieve the correct result should be the first result.

Thanks for any help.

View 3 Replies View Related

Query With A Table Name That Has A Space...

Jul 23, 2005

I have a table name in SQL Server 2000 that has a space in itex: aim internationalI had trouble just in the query analyzer with this..I had to place thename in brackets [] for it to work. But now I'm in Visual Studio .Net2003 and it gives me another problem. I get the table name from a dropdown list selection and send it to a query string. But is gives me thiserror:***************Line 1: Incorrect syntax near 'AIM international'.Exception Details: System.Data.SqlClient.SqlException: Line 1:Incorrect syntax near 'AIM international'.******************Here is the string:****************Dim sqlStr As String = "SELECT DISTINCT Last_Name FROM '" & PubName &"' WHERE PostalCode ='" & postalcode & "' And Title='" & title & "'ORDER BY Last_Name "**********************And the variable PubName is the string AIM international .I tried placing it in brackets like in the query analyzer :****************Dim sqlStr As String = "SELECT DISTINCT Last_Name FROM ['" & PubName &"'] WHERE PostalCode ='" & postalcode & "' And Title='" & title & "'ORDER BY Last_Name "*******************and I get this:*******************Invalid object name ''AIIM international''.Exception Details: System.Data.SqlClient.SqlException: Invalid objectname ''AIIM international''.*******************Any idea what I have to do for it to work ??? Can I use table nameswith spaces or it's just not a good idea???Thanks for the help guys!!JMT

View 6 Replies View Related

Can I Find The Drive Space Using A SQL Query?

Jun 1, 2001

Hey - I know that I can find space information about SQL Server. Allocated space, free space, used space, data space, etc... BUT is there a way that I can query how much total/available space is on the actual drive? For example, let's say that I have SQL installed on the D drive of a Server; i also have another application on that drive. I know that I can query how much room SQL Server is using, but can i query how much total/available space is on the drive? Any help appreciated.

View 1 Replies View Related

Lost Some Space (hardisk) When Execute Query

Jul 7, 2004

Dear All,

Got some problem...
how come i lost some space (hardisk) when
execute query...
(the query is listed below)

I want to know is it create some virtual tables or view when we execute query ???
N where's the location in our hardisk ??

thx


Listed Query
---------------------
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Absen.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
HRAbsensiKaryawan Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
Union
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
ADMAbsensiKaryawan Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
UNION
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
ADMAbsensiBulananSite Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
Union
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
HRAbsensiKaryawanNonStaf Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
UNION
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
HRAbsensiKaryawanStaf Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
UNION
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
LCAbsensiBulananSite Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
UNION
SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID,
Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID,
Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi,
Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName,
Data.GolonganID
FROM AMBranchMaster Bran RIGHT OUTER JOIN
HRDataKaryawan Data LEFT OUTER JOIN
HRDistribusiKaryawan Dis LEFT OUTER JOIN
TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON
Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN
LCAbsensiIndirect Absen ON Data.KaryawanID = Absen.KaryawanID ON
Bran.BranchID = Absen.BranchID LEFT OUTER JOIN
HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID
UNION
...................

----------------

View 2 Replies View Related

How To Find Free Disk Space Available From SQL Query

Jul 14, 2004

Hi all,
I have to find free disc space in a drive from SQL Query and i am using MSSQL200. Does any body know the command for the same.

Also if i want to find hard disk space of a different machine on network, it is possible to get the data??

Also can i get the CPU/Memory usage data of our machine by some SQL/C++ commands??

Please let me know if u know any of the answer...

thanks
Alok

View 1 Replies View Related

Know The Hard Disk's SQL Server Space Available From SQL Query

Oct 5, 2007



I would be able to determine how much hard disk space is available on the Server with a SQL Query, and from an other computer on the LAN.

How can I do something?

Thanks for your help.

View 4 Replies View Related

Can I Find The Space Allocated For A Database W/ Query Analyzer Using 7.0?

May 15, 2001

My group is trying to ensure that there is a sufficient amount of cushion between the space allocated and the current size of a database. I know that I can check this using the Enterprise Manager. Is there a stored procedure or a systems table that holds this information. I know that sp_spaceused will give me the unallocated space, but i want the allocated space. Any suggestions?

View 2 Replies View Related

Transact SQL :: Query To Return Free Space From Mounted Drive

Nov 25, 2015

Is it possible to find out available free space from a mounted / network drive using tsql query? I am using sql server 2008 R2.

View 5 Replies View Related

Help Me To Simplify This Process

Nov 6, 2007

SELECT WRREGN,WRCONO,WRDESC,WRWH01 as "WRWHSE", 1 as "WRORDER", WRDTMT
FROM PPTREASUSA.WHREGN
WHERE RTRIM(WRWH01)<>''
UNION
SELECT WRREGN,WRCONO,WRDESC,WRWH02 as "WRWHSE", 2 as "WRORDER", WRDTMT
FROM PPTREASUSA.WHREGN
WHERE RTRIM(WRWH02)<>''

.
.
.
.
.
UNION
SELECT WRREGN,WRCONO,WRDESC,WRW100 as "WRWHSE", 100 as "WRORDER", WRDTMT
FROM PPTREASUSA.WHREGN
WHERE RTRIM(WRW100)<>''


I have 100 queries pretty similar. Can I write one query for all instead?. How could I simplify this process? Using a cursor?




http://www.sqlserverstudy.com

View 12 Replies View Related

Trying To Simplify The Where Clause

Oct 11, 2007

I have the following where clause below which works fine. However, I have not been advised that the client also requires the range of codes: 1400-2089 and 2100-2299 which do not lend themselves readily to the IN statement.

I realize I could add yet another OR statement, however, I would prefer to simplify this query without it getting larger and larger with future request. Can someone suggest a better query?


Where

(DischDate between '2006-11-01' and '2007-09-30' And

PrinDxCode

IN ('042','140','2089','2031','2051','2100','2299','2300',

'2349','2350','2389','2390','2399','2732','2733','2849',

'2850','2883','2898','V073','V078','V100','V109','V580',

'V581','V661','V662','V671','V672','V711','V760','V769'))

Or (DischDate between '2006-11-01' and '2007-09-30' And

SecDx1Code

IN ('042','140','2089','2031','2051','2100','2299','2300',

'2349','2350','2389','2390','2399','2732','2733','2849',

'2850','2883','2898','V073','V078','V100','V109','V580',

'V581','V661','V662','V671','V672','V711','V760','V769'))

View 15 Replies View Related

Query Runs Fine In Query Analyser But Not The Query Debugger

Dec 19, 2003

I'm running a query, actually its an insert that works when using the TSQL below.

However when I try to use the debugger to step through and using the exact same values as those below I get the following error:

[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification

Its Killing me because everything else works, but this. Can somebody help.


DECLARE @NoteID INT,-- NULL OUTPUT,
@Note_Description NVARCHAR(3000),-- = NULL,
@Date DateTime,-- = NULL OUTPUT,
@ByWho NVARCHAR(30),-- = NULL,
@FK_Action_Performed NVARCHAR(40),-- = NULL,
@FK_UserID INT,-- = NULL,
@FK_JobID INT,-- = NULL,
@Job_Date DateTime,-- = NULL,
@Start DateTime,-- = NULL,
@Finish DateTime,-- = NULL,

@BeenRead NVARCHAR(10),-- = NULL

@FK_UserIDList NVARCHAR(4000)-- = NULL


--SET @NoteID = 409 --NULL OUTPUT,
SET @Note_Description = 'Tetsing'
--SET @Date DateTime = NULL OUTPUT,
SET @ByWho = 'GeorgeAgaian'
SET @FK_Action_Performed = 'Worked hard'
SET @FK_UserID = 5
SET @FK_JobID = 29
SET @Job_Date = 28/01/03
SET @Start = '1:00:20 PM'
SET @Finish = '1:00:20 PM'
SET @BeenRead = 'UnRead'

SET @FK_UserIDList = '1,2,3'


--AS

--SET NOCOUNT ON


SET NOCOUNT ON

SET XACT_ABORT ON

BEGIN TRANSACTION

SET @Date = GETDATE()

-- Insert Values into the customer table
INSERT Note (Note_Description,
Date,
ByWho,
FK_Action_Performed,
FK_UserID,
FK_JobID,
Job_Date,
Start,
Finish)

SELECT --@NoteID,
@Note_Description,
@Date,
@ByWho,
@FK_Action_Performed,
@FK_UserID,
@FK_JobID,

@Job_Date,
@Start,
@Finish

-- Get the new Customer Identifier, return as OUTPUT param
SELECT @NoteID = @@IDENTITY


-- Insert new notes for all the users that the note pertains to, in this case this will be by the assigned
-- users.
IF @FK_UserIDList IS NOT NULL
EXECUTE spInsertNotesByAssignedUsers @NoteID, @FK_UserIDList

-- Insert New Address record
-- Retrieve Address reference into @AddressId
-- EXEC spInsertForUserNote
-- @FK_UserID,
--@NoteID,
-- @BeenRead
-- @Fax,
-- @PKId,
-- @AddressId OUTPUT

COMMIT TRANSACTION

--------------------------------------------------
GO

View 1 Replies View Related

Query Diff Results From Ent Manager Query And Query Analizer

May 28, 2008

ok can someone tell me why i get two different answers for the same query. (looking for last day of month for a given date)

SELECT DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, CAST('12/20/2006' AS datetime)) + 1, 0)) AS Expr1
FROM testsupplierSCNCR
I am getting the result of 01/01/2007

but in query analizer I get the result of

12/31/2006

Why the different dates

View 4 Replies View Related

How To Simplify This Slow Stored Procedure

Jan 20, 2005

Dear Reader(s),

Is there anyway to write the following stored procedure without the loop so that it goes much faster? :confused:

----------------------------------------------------------------------------
use MJ_ReportBase
go
if exists(select 1 from sysobjects where type='P' and name='sp_Periode')
begin
drop procedure sp_Periode
end
go
create procedure sp_Periode
@start int
, @stop int
as
declare @x int

set @x = 0
set @x=@start

delete from tbl_periode

while (@x>=@stop)
begin

-- ---
-- ---
-- Create table tbl_inout
if exists(select 1 from sysobjects where type='U' and name='tbl_inout')
begin
drop table tbl_inout
end

select datetimestamp,accname,badgeid,personname,inoutreg into tbl_inout from WinXS..x18 where convert(varchar,datetimestamp,120)+' '+ltrim(str(id))+' '+ltrim(str(badgeid)) in
(select convert(varchar,max(datetimestamp),120)+' '+ltrim(str(max(id)))+' '+ltrim(str(badgeid)) as datetimestamp from WinXS..x18 where (accname='Kelder -1' or accname='Tnk Entree') and convert(varchar,datetimestamp,105)=convert(varchar ,getdate()-abs(@x),105) group by badgeid)
and badgeid>0
order by personname

-- ---
-- ---
-- Create table tbl_result

if exists(select 1 from sysobjects where type='U' and name='tbl_result')
begin
drop table tbl_result
end

-- ---
-- ---

select
convert(varchar,datetimestamp,105) 'DATUM'
, badgeid 'PAS'
, initials 'VOORNAAM'
, personname 'NAAM'
, convert(varchar,min(datetimestamp),108) 'MIN'
, convert(varchar,max(datetimestamp),108) 'MAX'
into
tbl_result
from
WinXS..x18
where
convert(varchar,datetimestamp,105)=convert(varchar ,getdate()-abs(@x),105)
and
accname in ('Kelder -1','Tnk Entree')
and badgeid>0
group by
convert(varchar,WinXS..x18.datetimestamp,105)
, badgeid
, initials
, personname
order by
initials
, personname asc
, convert(varchar,datetimestamp,105) asc

-- ---
-- ---
-- Rapportage tabel

insert into
tbl_periode
select
tbl_result.datum as DATUM
, ltrim(ltrim(rtrim(tbl_result.naam))+' '+ltrim(rtrim(isnull(tbl_result.voornaam,' ')))) as NAAM
, tbl_result.min as MIN
, tbl_result.max as MAX
, case tbl_inout.inoutreg when 1 then 'in' when 2 then 'out' else 'err' end as [IN/OUT]
, substring('00000',1,5-len(tbl_result.pas))+ltrim(str(tbl_result.pas)) as PAS
from
tbl_inout,tbl_result
where
tbl_result.datum+' '+tbl_result.max+' '+ltrim(str(tbl_result.pas))
= convert(varchar,tbl_inout.datetimestamp,105)+' '+convert(varchar,tbl_inout.datetimestamp,108)+' '+ltrim(str(badgeid))
order by
tbl_result.naam asc

-- ---
-- ---
--

set @x=@x-1
end
go

print 'Klaar!'
--------------------------------------------------------------------------

What it does is determining the minimum entry time and the maximum exiting time per day of people going true the main entrance of a building.

Many thanks in advance.
:)

View 3 Replies View Related

Stack Dump

Apr 26, 2007

Hi;

I am frequently seeing the below errors in our SQL 7 Server running on Windows NT. I need your help to analze the problem. Thanks.

nitconfig: Number of user connections limited to 32767.

Module(sqlservr+e4c0) (CMsqlExecContext::Execute+1bb)

Module(sqlservr+e9ab) (CMsqlExecContext::ExecuteStmts+11b)

Module(sqlservr+1ce59) (CStmtSelect::XretExecute+1f8)

Module(sqlservr+10d22) (CStmtQuery::FExecuteQuery+1df)

Module(sqlservr+11f86) (CQuery::Execute+4f)

Module(sqlservr+120f5) (CQueryScan::CQueryScan+22c)

Module(sqlservr+12336) (CQueryScan::InitLockClasses+c3)

Module(sqlservr+12373) (CTableIsolation::FNeedLockClass+14)

Short Stack Dump

******************************************************************************
*
* BEGIN STACK DUMP:
* 04/25/07 08:32:19 spid 22
*
* Exception Address = 00412373 (CTableIsolation::FNeedLockClass + 14)
* Exception Code = c0000005 E
* Access Violation occurred reading address 00000014
* Input Buffer 132 bytes -
* S E L E C T S u p F r o m , S u p T o F R O M S u p p o r t P r
* o f i l e s w h e r e S u p P r o f i l e = 3 0 4 5
*
*
* MODULE BASE END SIZE
* sqlservr 00400000 008d2fff 004d3000
* ntdll 77f60000 77fbefff 0005f000
* KERNEL32 77f00000 77f5efff 0005f000
* ADVAPI32 77dc0000 77dfefff 0003f000
* USER32 77e70000 77ec1fff 00052000
* GDI32 78140000 78174fff 00035000
* RPCRT4 77e10000 77e66fff 00057000
* ole32 77b20000 77bd0fff 000b1000
* OLEAUT32 65340000 653dafff 0009b000
* VERSION 77a90000 77a9afff 0000b000
* SHELL32 77c40000 77d7afff 0013b000
* COMCTL32 71710000 71793fff 00084000
* LZ32 779c0000 779c7fff 00008000
* opends60 41060000 41085fff 00026000
* ums 41090000 4109cfff 0000d000
* MSVCRT 78000000 78045fff 00046000
* sqlsort 04000000 0408efff 0008f000
* MSVCIRT 780a0000 780b1fff 00012000
* sqlevn70 410a0000 410a6fff 00007000
* rpcltc1 77bf0000 77bf6fff 00007000
* COMNEVNT 410b0000 410fefff 0004f000
* ODBC32 1f7d0000 1f803fff 00034000
* comdlg32 77d80000 77db1fff 00032000
* SQLWOA 41100000 4110bfff 0000c000
* odbcint 1f8c0000 1f8d5fff 00016000
* NDDEAPI 75a80000 75a86fff 00007000
* WINSPOOL 77c00000 77c17fff 00018000
* SQLTrace 41130000 4117dfff 0004e000
* NETAPI32 4ca00000 4ca40fff 00041000
* NETRAP 77840000 77848fff 00009000
* SAMLIB 777e0000 777ecfff 0000d000
* WSOCK32 776d0000 776d7fff 00008000
* WS2_32 776b0000 776c3fff 00014000
* WS2HELP 776a0000 776a6fff 00007000
* WLDAP32 77950000 77978fff 00029000
* SQLFTQRY 41020000 4103afff 0001b000
* SSNMPN70 41190000 41195fff 00006000
* SSMSSO70 411a0000 411aafff 0000b000
* SSMSRP70 411b0000 411b7fff 00008000
* ENUDTC 74e20000 74e36fff 00017000
* XOLEHLP 74e40000 74e48fff 00009000
* MTXCLU 74e50000 74e5cfff 0000d000
* ADME 74e60000 74e72fff 00013000
* DTCUtil 74e80000 74e89fff 0000a000
* DTCTRACE 74e90000 74e96fff 00007000
* CLUSAPI 7f230000 7f23cfff 0000d000
* RESUTILS 7f250000 7f259fff 0000a000
* MSDTCPRX 74ea0000 74ed0fff 00031000
* DTCCM 74ee0000 74efdfff 0001e000
* msafd 77660000 7766efff 0000f000
* wshtcpip 77690000 77698fff 00009000
* rpclts1 77e00000 77e05fff 00006000
* RpcLtScm 755b0000 755bafff 0000b000
* MSWSOCK 77670000 77684fff 00015000
* rnr20 75600000 7560dfff 0000e000
* RpcLtCcm 756d0000 756defff 0000f000
* security 76e70000 76e81fff 00012000
* msapsspc 756e0000 756f3fff 00014000
* MSVCRT40 779d0000 779e4fff 00015000
* schannel 77400000 7741dfff 0001e000
* MSOSS 75710000 75734fff 00025000
* CRYPT32 75740000 757b4fff 00075000
* MSASN1 757c0000 757cffff 00010000
* msnsspc 757d0000 757eefff 0001f000
* digest 757f0000 757fffff 00010000
* SQLRGSTR 01b60000 01b64fff 00005000
* xpsqlbot 01bf0000 01bf5fff 00006000
* sqlboot 01c00000 01c07fff 00008000
* EntApi 0a000000 0a011fff 00012000
* PSAPI 76bf0000 76bfafff 0000b000
* WININET 01db0000 01e45fff 00096000
* SHLWAPI 01e50000 01eb8fff 00069000
* xpstar 02440000 02470fff 00031000
* SQLWID 02480000 02485fff 00006000
* SQLSVC 02490000 024a8fff 00019000
* odbcbcp 024b0000 024b5fff 00006000
* SQLRESLD 024c0000 024c5fff 00006000
* W95SCM 024d0000 024d7fff 00008000
* SQLSVC 024e0000 024e5fff 00006000
* sqlimage 02590000 025bcfff 0002d000
*
* Edi: 00100C70: 000a0100 00030008 00000000 00000000 00100e70 00100e50
* Esi: 00000000:
* Eax: 00000000:
* Ebx: 00000004:
* Ecx: 00000000:
* Edx: 00000004:
* Eip: 00412373: 007ea6e2 05f61577 01f88318 468b0013 d49f850f 00147e83
* Ebp: 01C8F864: 00000001 00000000 2149a1e4 00000000 00412336 01c8f898
* SegCs: 0000001B:
* EFlags: 00010246: 003d0052 00490044 005f004c 00410043 004f004c 005f0053
* Esp: 01C8F854: 00412336 01c8f898 00000000 00000004 2149a1e4 00000000
* SegSs: 00000023:
*******************************************************************************

SqlDumpExceptionHandler: Process 22 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Using 'sqlimage.dll' version '4.0.5'
Stack Dump being sent to C:MSSQL7logSQL00026.dmp

Sunrise406, creation date and time: 2001/11/16(14:34:00), first LSN: 647599:6555:1, last LSN: 647633:8427:1, striped: 0, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:MSSQL7BACKUPSunrise406_tlog_200704250000.TRN'}).

Using 'xpstar.dll' version '2000.28.09' to execute extended stored procedure 'xp_regread'.

Database backed up with following information: Database: Sunrise406, creation date and time: 2001/11/16(14:34:00), pages dumped: 47456, first LSN: 647633:8425:1, last LSN: 647633:8427:1, sort order: 52, striped: 0, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:MSSQL7ackupSunriseDailyBackup9pm'}).

View 5 Replies View Related

SqlDumpExceptionHandler - STACK DUMP

Oct 10, 2007

Hi,

I noted some strange errors on my server log (SQL 2005):

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Date,Source,Severity,Message
10/02/2007 09:15:24,Server,Unknown,A user request from the session with SPID 191 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory.
10/02/2007 09:15:24,Server,Unknown,Error: 17310<c/> Severity: 20<c/> State: 1.
10/02/2007 09:15:24,spid191,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
10/02/2007 09:15:23,spid191,Unknown,Stack Signature for the dump is 0x724D13B0
10/02/2007 09:15:23,spid191,Unknown,78132A36 Module(MSVCR80+00002A36)
10/02/2007 09:15:23,spid191,Unknown,781329AA Module(MSVCR80+000029AA)
10/02/2007 09:15:23,spid191,Unknown,010D83F0 Module(sqlservr+000D83F0)
10/02/2007 09:15:23,spid191,Unknown,010D746E Module(sqlservr+000D746E)
10/02/2007 09:15:23,spid191,Unknown,010D7B71 Module(sqlservr+000D7B71)
10/02/2007 09:15:23,spid191,Unknown,010D764A Module(sqlservr+000D764A)
10/02/2007 09:15:23,spid191,Unknown,010086E7 Module(sqlservr+000086E7)
10/02/2007 09:15:23,spid191,Unknown,010089C5 Module(sqlservr+000089C5)
10/02/2007 09:15:23,spid191,Unknown,0100889F Module(sqlservr+0000889F)
10/02/2007 09:15:23,spid191,Unknown,01041C35 Module(sqlservr+00041C35)
10/02/2007 09:15:23,spid191,Unknown,010438E5 Module(sqlservr+000438E5)
10/02/2007 09:15:23,spid191,Unknown,0102C5F8 Module(sqlservr+0002C5F8)
10/02/2007 09:15:23,spid191,Unknown,011D37E7 Module(sqlservr+001D37E7)
10/02/2007 09:15:23,spid191,Unknown,01BDBEB6 Module(sqlservr+00BDBEB6)
10/02/2007 09:15:23,spid191,Unknown,013C6DB8 Module(sqlservr+003C6DB8)
10/02/2007 09:15:23,spid191,Unknown,01C11D65 Module(sqlservr+00C11D65)
10/02/2007 09:15:23,spid191,Unknown,0102C5F8 Module(sqlservr+0002C5F8)
10/02/2007 09:15:23,spid191,Unknown,011D37E7 Module(sqlservr+001D37E7)
10/02/2007 09:15:23,spid191,Unknown,01BDBEB6 Module(sqlservr+00BDBEB6)
10/02/2007 09:15:23,spid191,Unknown,0103D0C6 Module(sqlservr+0003D0C6)
10/02/2007 09:15:23,spid191,Unknown,0103D23D Module(sqlservr+0003D23D)
10/02/2007 09:15:23,spid191,Unknown,0103D2FE Module(sqlservr+0003D2FE)
10/02/2007 09:15:23,spid191,Unknown,0103D441 Module(sqlservr+0003D441)
10/02/2007 09:15:23,spid191,Unknown,010784B4 Module(sqlservr+000784B4)
10/02/2007 09:15:23,spid191,Unknown,01E22809 Module(sqlservr+00E22809)
10/02/2007 09:15:23,spid191,Unknown,01E28713 Module(sqlservr+00E28713)
10/02/2007 09:15:23,spid191,Unknown,01E15AA8 Module(sqlservr+00E15AA8)
10/02/2007 09:15:23,spid191,Unknown,01E15B68 Module(sqlservr+00E15B68)
10/02/2007 09:15:23,spid191,Unknown,0102E827 Module(sqlservr+0002E827)
10/02/2007 09:15:23,spid191,Unknown,019E9DEB Module(sqlservr+009E9DEB)
10/02/2007 09:15:23,spid191,Unknown,01DA687B Module(sqlservr+00DA687B)
10/02/2007 09:15:23,spid191,Unknown,01DA9914 Module(sqlservr+00DA9914)
10/02/2007 09:15:23,spid191,Unknown,010D3CAC Module(sqlservr+000D3CAC)
10/02/2007 09:15:23,spid191,Unknown,010040C2 Module(sqlservr+000040C2)
10/02/2007 09:15:23,spid191,Unknown,01002C90 Module(sqlservr+00002C90)
10/02/2007 09:15:23,spid191,Unknown,* Short Stack Dump
10/02/2007 09:15:23,spid191,Unknown,* -------------------------------------------------------------------------------
10/02/2007 09:15:23,spid191,Unknown,* *******************************************************************************
10/02/2007 09:15:23,spid191,Unknown,* SegSs: 0000002B:
10/02/2007 09:15:23,spid191,Unknown,* Esp: 1054EBAC: 00000038 C02280E8 00000001 00000000 00000000 1054EBE4
10/02/2007 09:15:23,spid191,Unknown,* EFlags: 00010246: 0057005C 004E0049 004F0044 00530057 0073005C 00730079
10/02/2007 09:15:23,spid191,Unknown,* SegCs: 00000023:
10/02/2007 09:15:23,spid191,Unknown,* Ebp: 1054EBC0: 1054EBE4 010040C2 0000096C FFFFFFFF 1054EC10 00000000
10/02/2007 09:15:23,spid191,Unknown,* Eip: 01002C90: 0AB10FF0 850FC085 0005BAD0 0F003B83 0013C685 0C7D8300
10/02/2007 09:15:23,spid191,Unknown,* Edx: 00000028:
10/02/2007 09:15:23,spid191,Unknown,* Ecx: 0000096C:
10/02/2007 09:15:23,spid191,Unknown,* Ebx: 00000020:
10/02/2007 09:15:23,spid191,Unknown,* Eax: 00000000:
10/02/2007 09:15:23,spid191,Unknown,* Esi: C02280E8: 00000000 00000000 BAA660F0 CF2BC0F0 00000001 009C61F0
10/02/2007 09:15:23,spid191,Unknown,* Edi: 00000028:
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* dbghelp 0D190000 0D2A7FFF 00118000
10/02/2007 09:15:23,spid191,Unknown,* MSVCR71 7C340000 7C395FFF 00056000
10/02/2007 09:15:23,spid191,Unknown,* XPMetaphone 0DD00000 0DD07FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* xplog70 0DE00000 0DE02FFF 00003000
10/02/2007 09:15:23,spid191,Unknown,* xplog70 0DD20000 0DD2BFFF 0000c000
10/02/2007 09:15:23,spid191,Unknown,* xpsqlbot 0EA50000 0EA55FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* xpstar90 0DC00000 0DC25FFF 00026000
10/02/2007 09:15:23,spid191,Unknown,* SQLSVC90 0DBF0000 0DBF2FFF 00003000
10/02/2007 09:15:23,spid191,Unknown,* odbcint 0DBD0000 0DBE6FFF 00017000
10/02/2007 09:15:23,spid191,Unknown,* ATL80 7C630000 7C64AFFF 0001b000
10/02/2007 09:15:23,spid191,Unknown,* SqlResourceLoader 0D8F0000 0D8F5FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* SQLSVC90 0D8C0000 0D8D9FFF 0001a000
10/02/2007 09:15:23,spid191,Unknown,* BatchParser90 0D890000 0D8ADFFF 0001e000
10/02/2007 09:15:23,spid191,Unknown,* ODBC32 0D850000 0D88CFFF 0003d000
10/02/2007 09:15:23,spid191,Unknown,* SQLSCM90 0D830000 0D838FFF 00009000
10/02/2007 09:15:23,spid191,Unknown,* xpstar90 0D7D0000 0D814FFF 00045000
10/02/2007 09:15:23,spid191,Unknown,* msxml3 72E50000 72F61FFF 00112000
10/02/2007 09:15:23,spid191,Unknown,* msxml2 0B7E0000 0B88EFFF 000af000
10/02/2007 09:15:23,spid191,Unknown,* msxmlsql 78800000 788DEFFF 000df000
10/02/2007 09:15:23,spid191,Unknown,* msftepxy 09790000 097A4FFF 00015000
10/02/2007 09:15:23,spid191,Unknown,* SQLNCLIR 095D0000 09602FFF 00033000
10/02/2007 09:15:23,spid191,Unknown,* comdlg32 762B0000 762F9FFF 0004a000
10/02/2007 09:15:23,spid191,Unknown,* COMCTL32 77530000 775C6FFF 00097000
10/02/2007 09:15:23,spid191,Unknown,* sqlncli 337A0000 339BDFFF 0021e000
10/02/2007 09:15:23,spid191,Unknown,* CLBCatQ 777B0000 77832FFF 00083000
10/02/2007 09:15:23,spid191,Unknown,* xpsp2res 10000000 102C4FFF 002c5000
10/02/2007 09:15:23,spid191,Unknown,* ntdsapi 766F0000 76704FFF 00015000
10/02/2007 09:15:23,spid191,Unknown,* SAMLIB 094A0000 094AEFFF 0000f000
10/02/2007 09:15:23,spid191,Unknown,* NTMARTA 77E00000 77E21FFF 00022000
10/02/2007 09:15:23,spid191,Unknown,* dssenh 094B0000 094D3FFF 00024000
10/02/2007 09:15:23,spid191,Unknown,* imagehlp 76C10000 76C38FFF 00029000
10/02/2007 09:15:23,spid191,Unknown,* WINTRUST 76BB0000 76BDAFFF 0002b000
10/02/2007 09:15:23,spid191,Unknown,* dbghelp 09130000 09247FFF 00118000
10/02/2007 09:15:23,spid191,Unknown,* msfte 08ED0000 09127FFF 00258000
10/02/2007 09:15:23,spid191,Unknown,* security 71F60000 71F63FFF 00004000
10/02/2007 09:15:23,spid191,Unknown,* rasadhlp 76F80000 76F84FFF 00005000
10/02/2007 09:15:23,spid191,Unknown,* wshtcpip 07DB0000 07DB7FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* hnetcfg 07D10000 07D68FFF 00059000
10/02/2007 09:15:23,spid191,Unknown,* WLDAP32 76F10000 76F3DFFF 0002e000
10/02/2007 09:15:23,spid191,Unknown,* winrnr 76F70000 76F76FFF 00007000
10/02/2007 09:15:23,spid191,Unknown,* DNSAPI 76ED0000 76EF8FFF 00029000
10/02/2007 09:15:23,spid191,Unknown,* WSOCK32 07AD0000 07AD8FFF 00009000
10/02/2007 09:15:23,spid191,Unknown,* VERSION 77B90000 77B97FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* MTXCLU 74F40000 74F58FFF 00019000
10/02/2007 09:15:23,spid191,Unknown,* msvcp60 07A60000 07AC4FFF 00065000
10/02/2007 09:15:23,spid191,Unknown,* MSDTCPRX 079E0000 07A57FFF 00078000
10/02/2007 09:15:23,spid191,Unknown,* XOLEHLP 079D0000 079D5FFF 00006000
10/02/2007 09:15:23,spid191,Unknown,* COMRES 77010000 770D5FFF 000c6000
10/02/2007 09:15:23,spid191,Unknown,* schannel 76750000 76776FFF 00027000
10/02/2007 09:15:23,spid191,Unknown,* cryptdll 766E0000 766EBFFF 0000c000
10/02/2007 09:15:23,spid191,Unknown,* Kerberos 71CA0000 71CF7FFF 00058000
10/02/2007 09:15:23,spid191,Unknown,* iphlpapi 76CF0000 76D09FFF 0001a000
10/02/2007 09:15:23,spid191,Unknown,* msv1_0 76C90000 76CB6FFF 00027000
10/02/2007 09:15:23,spid191,Unknown,* msnsspc 71E20000 71E6FFFF 00050000
10/02/2007 09:15:23,spid191,Unknown,* MSVCRT40 78080000 78090FFF 00011000
10/02/2007 09:15:23,spid191,Unknown,* msapsspc 71E00000 71E13FFF 00014000
10/02/2007 09:15:23,spid191,Unknown,* MSCOREE 79000000 79044FFF 00045000
10/02/2007 09:15:23,spid191,Unknown,* AUTHZ 76C40000 76C53FFF 00014000
10/02/2007 09:15:23,spid191,Unknown,* rsaenh 06450000 0647EFFF 0002f000
10/02/2007 09:15:23,spid191,Unknown,* SQLOS 344D0000 344D4FFF 00005000
10/02/2007 09:15:23,spid191,Unknown,* sqlevn70 4F610000 4F7A0FFF 00191000
10/02/2007 09:15:23,spid191,Unknown,* RESUTILS 74EF0000 74F02FFF 00013000
10/02/2007 09:15:23,spid191,Unknown,* OLEAUT32 77D00000 77D8BFFF 0008c000
10/02/2007 09:15:23,spid191,Unknown,* ole32 77670000 777A3FFF 00134000
10/02/2007 09:15:23,spid191,Unknown,* CLUSAPI 74DE0000 74DF1FFF 00012000
10/02/2007 09:15:23,spid191,Unknown,* instapi 48060000 48069FFF 0000a000
10/02/2007 09:15:23,spid191,Unknown,* psapi 76B70000 76B7AFFF 0000b000
10/02/2007 09:15:23,spid191,Unknown,* comctl32 7DBD0000 7DCD2FFF 00103000
10/02/2007 09:15:23,spid191,Unknown,* SHLWAPI 77DA0000 77DF1FFF 00052000
10/02/2007 09:15:23,spid191,Unknown,* SHELL32 7C8D0000 7D0D2FFF 00803000
10/02/2007 09:15:23,spid191,Unknown,* NETAPI32 71C40000 71C97FFF 00058000
10/02/2007 09:15:23,spid191,Unknown,* opends60 333E0000 333E6FFF 00007000
10/02/2007 09:15:23,spid191,Unknown,* USERENV 76920000 769E3FFF 000c4000
10/02/2007 09:15:23,spid191,Unknown,* WS2HELP 71BF0000 71BF7FFF 00008000
10/02/2007 09:15:23,spid191,Unknown,* WS2_32 71C00000 71C16FFF 00017000
10/02/2007 09:15:23,spid191,Unknown,* MSWSOCK 7DB30000 7DBAFFFF 00080000
10/02/2007 09:15:23,spid191,Unknown,* Secur32 7D8D0000 7D91FFFF 00050000
10/02/2007 09:15:23,spid191,Unknown,* MSASN1 76190000 761A1FFF 00012000
10/02/2007 09:15:23,spid191,Unknown,* CRYPT32 761B0000 76242FFF 00093000
10/02/2007 09:15:23,spid191,Unknown,* GDI32 7D800000 7D88FFFF 00090000
10/02/2007 09:15:23,spid191,Unknown,* USER32 7D930000 7D9FFFFF 000d0000
10/02/2007 09:15:23,spid191,Unknown,* RPCRT4 7DA20000 7DAFFFFF 000e0000
10/02/2007 09:15:23,spid191,Unknown,* ADVAPI32 77F50000 77FEBFFF 0009c000
10/02/2007 09:15:23,spid191,Unknown,* MSVCP80 7C420000 7C4A6FFF 00087000
10/02/2007 09:15:23,spid191,Unknown,* msvcrt 77BA0000 77BF9FFF 0005a000
10/02/2007 09:15:23,spid191,Unknown,* MSVCR80 78130000 781CAFFF 0009b000
10/02/2007 09:15:23,spid191,Unknown,* kernel32 7D4C0000 7D5EFFFF 00130000
10/02/2007 09:15:23,spid191,Unknown,* ntdll 7D600000 7D6EFFFF 000f0000
10/02/2007 09:15:23,spid191,Unknown,* sqlservr 01000000 02BA7FFF 01ba8000
10/02/2007 09:15:23,spid191,Unknown,* MODULE BASE END SIZE
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* TableConfig where number = 186
10/02/2007 09:15:23,spid191,Unknown,* 4240-8be7-b3e5e3a0398e";Local Database="db_name"select val from dbo.Tab
10/02/2007 09:15:23,spid191,Unknown,* c8faa7889b9e53cd3d8b#198;Service="SqlQueryNotificationService-70595aa0-5133-
10/02/2007 09:15:23,spid191,Unknown,* #362; #154;180f615b-9449-472b-bea0-64a372ffd178;c39a6e91984467e28bf6
10/02/2007 09:15:23,spid191,Unknown,* Input Buffer 496 bytes -
10/02/2007 09:15:23,spid191,Unknown,* Access Violation occurred writing address 00000028
10/02/2007 09:15:23,spid191,Unknown,* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
10/02/2007 09:15:23,spid191,Unknown,* Exception Address = 01002C90 Module(sqlservr+00002C90)
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* 10/02/07 09:15:23 spid 191
10/02/2007 09:15:23,spid191,Unknown,* BEGIN STACK DUMP:
10/02/2007 09:15:23,spid191,Unknown,*
10/02/2007 09:15:23,spid191,Unknown,* *******************************************************************************
10/02/2007 09:15:23,spid191,Unknown,SqlDumpExceptionHandler: Process 191 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
10/02/2007 09:15:23,spid191,Unknown,***Stack Dump being sent to d:Microsoft SQL ServerMSSQL.1MSSQLLOGSQLDump2875.txt
10/02/2007 09:15:22,spid191,Unknown,Using 'dbghelp.dll' version '4.0.5'
10/02/2007 09:14:47,Server,Unknown,A user request from the session with SPID 243 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory.
10/02/2007 09:14:47,Server,Unknown,Error: 17310<c/> Severity: 20<c/> State: 1.
10/02/2007 09:14:47,spid243,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
10/02/2007 09:14:46,spid243,Unknown,Stack Signature for the dump is 0x724D13B0
10/02/2007 09:14:46,spid243,Unknown,78132A36 Module(MSVCR80+00002A36)
10/02/2007 09:14:46,spid243,Unknown,781329AA Module(MSVCR80+000029AA)
10/02/2007 09:14:46,spid243,Unknown,010D83F0 Module(sqlservr+000D83F0)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Could somebody explain me what may cause this error and how repair this, please.

--
Regards,
anxcomp

View 5 Replies View Related

Stack Overflow Sql 2005 Clr

Aug 29, 2007

Please help.
I have a sql 2005 table-value function coded in .net. I'm getting a horrible stack overflow exception with the following call :

select * from dbo.clr_DecodeTime(-15809);

The code is here :

public partial class UserDefinedFunctions

{

[SqlFunction(TableDefinition= "ArrTime nvarchar(4), DepTime nvarchar(4)",FillRowMethodName="ProcessesFillRowTime")]

public static IEnumerable clr_DecodeTime(int EncodedTime)

{

List<Airports> airport = new List<Airports>();

Airports a = new Airports();

a.ArrTime = "1000";

a.DepTime = "1100";

airport.Add(a);

return airport;

}

public static void ProcessesFillRowTime(Object o, out SqlChars arrTime, out SqlChars depTime)

{

Airports airport = o as Airports;

arrTime = new SqlChars(airport.ArrTime);

depTime = new SqlChars(airport.DepTime);

}

};

catch (Exception Ex)

{

throw new Exception(Ex.Message);

}

public class Airports

{

private string arrcode;

public string ArrCode

{

get

{

return arrcode;

}

set

{

arrcode = value;

}

}

private string depcode;

public string DepCode

{

get

{

return depcode;

}

set

{

depcode = value;

}

}

private string depdate;

public string DepDate

{

get

{

return DepDate;

}

set

{

DepDate = value;

}

}

private string arrdate;

public string ArrDate

{

get

{

return ArrDate;

}

set

{

ArrDate = value;

}

}



private string arrtime;

public string ArrTime

{

get

{

return ArrTime;

}

set

{

ArrTime = value;

}

}



private string deptime;

public string DepTime

{

get

{

return DepTime;

}

set

{

DepTime = value;

}

}

}

}
The message I get back is :

Msg 6538, Level 16, State 49, Line 1

.NET Framework execution was aborted because of stack overflow.
Every time I try and debug the function my pc hang. ps I'm using vista business edition and vs 2005.

View 3 Replies View Related

Stack Error - EXCEPTION_ACCESS_VIOLATION

Nov 16, 2007

Folks:


I am getting the following stack error in my SQL Server logs. I understand that there is a Microsoft Hotfix available for this and would like to know where will I find the HOTFIX for this because I didn't find it on Microsoft Website. We are currently on SQL 2000 SP 4 (Windows Server 2003 SP1).


Thanks !


*****************************************************************************
Computer type is AT/AT COMPATIBLE.
Bios Version is IBM - 1000
Current time is 09:02:25 11/16/07.
4 Intel x86 level 6, 2992 Mhz processor(s).
Windows NT 5.2 Build 3790 CSD Service Pack 1.


Memory
MemoryLoad = 56%
Total Physical = 4095 MB
Available Physical = 1800 MB
Total Page File = 8026 MB
Available Page File = 6052 MB
Total Virtual = 2047 MB
Available Virtual = 203 MB

*Stack Dump being sent to e:mssql2000dataMSSQLlogSQLDump0014.txt
* *****************************************************************************
**
*
* BEGIN STACK DUMP:
* 11/16/07 09:02:25 spid 59
*
* Exception Address = 009BF883 (CDStream:rintDumpHeader + 000007A7 Line 0+0
0000000)
* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
* Access Violation occurred reading address FFFF0002
* Input Buffer 92 bytes -
* exec dbo.QS_SoSSE15_ConnectionDetails @spid=67
*
*
* MODULE BASE END SIZE
* sqlservr 00400000 00CBAFFF 008bb000
* ntdll 7C800000 7C8BFFFF 000c0000
* kernel32 77E40000 77F41FFF 00102000
* ADVAPI32 77F50000 77FEBFFF 0009c000
* RPCRT4 77C50000 77CEEFFF 0009f000
* MSVCP71 7C3A0000 7C41AFFF 0007b000
* MSVCR71 7C340000 7C395FFF 00056000
* opends60 41060000 41065FFF 00006000
* SHELL32 7C8D0000 7D0D3FFF 00804000
* msvcrt 77BA0000 77BF9FFF 0005a000
* GDI32 77C00000 77C48FFF 00049000
* USER32 77380000 77411FFF 00092000
* SHLWAPI 77DA0000 77DF1FFF 00052000
* sqlsort 42AE0000 42B6FFFF 00090000
* ums 41070000 4107DFFF 0000e000

*****************************************************************************


View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved