Re: Insert to temporary table causes EXCEPTION_ACCESS_VIOLATION

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Ron L (rlounsbury_at_bogusAddress.com)
Date: 07/08/04


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.)
>
>



Relevant Pages

  • Re: HELP! Need AD Query for Last login
    ... query the DCs in the USA domain, how would I modify the script? ... I'm new to VB script and making this simple modification is beyond me at ... >> ' Because the lastLogon attribute is not replicated, ... Then, for each Domain Controller, ADO is used to search the ...
    (microsoft.public.scripting.vbscript)
  • Re: LDAP query information
    ... a "Dim" statement. ... script is run. ... Microsoft MVP Scripting and ADSI ... Can you please provide me info on what to do with the below query? ...
    (microsoft.public.windows.server.scripting)
  • Re: LDAP query information
    ... execution of the vbscript? ... The error message indicates the line number in the script, ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)
  • Re: An application, script, or AD Saved query that ...
    ... It is a multi-step operation as you can't create a query that says give me all users who aren't in a mail enabled group. ... So the most efficient way I can visualize this is that your script will need to find all members of all mailenabled groups. ... This you will enumerate the members and stick them in a hash/dictionary/whatever it is called in the scripting language you use, basically you want an associative array. ...
    (microsoft.public.windows.server.active_directory)
  • Re: LDAP query information
    ... The error message indicates the line number in the script, ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... Set adoConnection = CreateObject ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)