Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION
From: Ron L (rlounsbury_at_bogusAddress.com)
Date: 07/08/04
- Next message: Aaron [SQL Server MVP]: "Re: SQL longer in SP than out of the SP"
- Previous message: Goober at christianDOTnet: "Re: Question about sql job, SQL 7 versus upgrade to SQL 2000"
- In reply to: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Next in thread: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Reply: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 8 Jul 2004 11:47:38 -0400
Aaron
Thanks for the reply, I will answer your questions in line, but I am
afraid that you are concentrating on the wrong portion of the code. The
CREATE TABLE works OK, it is the INSERT that dies. SELECT @@Version returns
the following:
Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Desktop Engine on Windows NT 5.0 (Build 2195: Service Pack 4)
Running this script
SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(15)) AS 'Version',
CAST(SERVERPROPERTY('ProductLevel') AS VARCHAR(15)) AS 'Level',
CAST(SERVERPROPERTY('Edition') AS VARCHAR(30)) AS 'Edition',
CAST(SERVERPROPERTY('InstanceName') AS VARCHAR(25)) AS 'Instance Name',
CAST(SERVERPROPERTY('IsIntegratedSecurityOnly') AS VARCHAR(8)) AS
'IsIntegratedSecurityOnly'
Gives:
Version Level Edition Instance Name
IsIntegratedSecurityOnly
--------------- --------------- ------------------------------ -------------
------------ ------------------------
8.00.760 SP3 Desktop Engine NULL
1
Thanks,
Ron L
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:%23r%23QU1PZEHA.2260@TK2MSFTNGP12.phx.gbl...
> > /* Create a temporary Change Log information table. If the *
> > * update is successful, this data will be copied to the *
> > * TSL change log table. */
> > IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE
> > ID=OBJECT_ID('tempdb..#ChangeLogs') AND
xtype
> =
> > 'u')
> > DROP Table #ChangeLogs
>
> Why would your #temp table already exist, at the beginning of the
procedure?
Just a safety measure to be sure that I don't attempt to recreate an
existing table and get an error from it
> Have you ever actually come across this?
I believe that we have seen this in the development phase while running the
SP from Query Analyzer (which keeps the connection open) if the SP dies
before the DROP TABLE
>Why does your procedure not have a DROP TABLE #ChangeLogs at the end?
OOPS!
>
> In any case, rather than perform a query directly against
> tempdb..sysobjects, how about:
>
> IF OBJECT_ID('tempdb..#ChangeLogs') IS NOT NULL
> DROP TABLE #ChangeLogs
We simply copied code (that works) from the code you get when you script a
table in SQL
>
> Essentially, this does the same thing, but I believe the optimizer / query
> engine might behave a little differently. Also, your check for xtype is
> redundant. What other kind of object is going to be named #ChangeLogs and
> stored in tempdb?
>
> > Can anyone tell me what is happening and how to fix it?
>
> I can't reproduce, on 8.00.760, 8.00.859, 8.00.926, or 8.00.936.
>
> What version are you using (SELECT @@VERSION)?
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
- Next message: Aaron [SQL Server MVP]: "Re: SQL longer in SP than out of the SP"
- Previous message: Goober at christianDOTnet: "Re: Question about sql job, SQL 7 versus upgrade to SQL 2000"
- In reply to: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Next in thread: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Reply: Aaron [SQL Server MVP]: "Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|