A severe error occurred on the current command. The results, if any, should be discarded.

  • Hi While running the query ,

    I am getting the following error :-

    Msg 0, Level 11, State 0, Line 0

    A severe error occurred on the current command. The results, if any, should be discarded.

    The query is :-

    ;with cte as (

    select 'Bldgclass' as BldgClass,RuleId,7 As CurVerNum , 'State' As State1

    from ERM..RuleConstructionCS

    where ruleid between 40500001 and 40599999 and SourceCode=29

    ) , CTE1 AS (

    select GrpAddressID,SourceCode,RuleID,UID

    FROM

    ES_Archive..RuletrackerArch

    where SourceCode=29 and VersionNum=6)

    ,CTE2 as (

    SELECT GrpAddressId,SourceCode,UID FROM CTE A INNER JOIN CTE1 B ON

    A.RULEID = B.RULEID),CTE3 AS (

    SELECT DISTINCT StateCode,UID FROM ES_Archive..EmporisMRSTGMappedArch A

    INNER JOIN ES_Archive.dbo.tmpCurrMinusPrevGrpAddressId B

    ON A.GRPAddressID = B.grpAddressID

    )

    SELECT GrpAddressID into abc FROM CTE2 INNER JOIN CTE3 ON CTE2.UID = CTE3.UID

    Please help me out !!!

    Regards,

    Ankit

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • i get this a lot when i use an explicit transaction, which i then role back; afterwards, in that situation i get the same error you reported when i then try to parse the same query;

    you can ignore it, or explicitly re-connect(right click your SSMS..Connection>>Change Connection (put in the same info again)

    it's no bi deal, and not a show stopper, just an annoyance.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Unfortunately, it has become a show stopper for me as the query fetches some ad-hoc report and the same is failing.

    Can you let me know why exactly it hapenes ?

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • Any 823 or 824 errors in the SQL Server error log?

    Eddie Wuerch
    MCM: SQL

  • Do each of the CTE's run as standalone queries?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply