Re: IDENTITY_INSERT Problems

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: drs (dsavitsk_at_remove-and)
Date: 07/27/04


Date: Mon, 26 Jul 2004 22:53:07 -0500


"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:uNJuBv3cEHA.1888@TK2MSFTNGP12.phx.gbl...
> Why would you post dummy code and not "the real code that wouldn't run"?
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "drs" <dsavitsk@remove-and respell-to-send-mail-YAH-HEW.com> wrote in
> message news:10gb6057novl208@corp.supernews.com...
> > "Jacco Schalkwijk" <jacco.please.reply@to.newsgroups.mvps.org.invalid>
> > wrote
> > in message news:Oix2sq1cEHA.244@TK2MSFTNGP12.phx.gbl...
> >> Hi drs,
> >>
> >> I didn't check all your code, but I noticed that the Field_2 column you
> > use
> >> is NOT NULL, and in the code you post you don't insert a value in this
> >> column. I.e. the code as you have posted it will fail because of this.
> >
> > Just the example code I posted, not the real code that wouldn't run.
> >

By "dummy code" I mean that I left out the line where I added a value for
the NOT NULL field -- a perfectly reasonable thing to do as actually leaving
out this line would not cause an error until calling the Update() function.
Further, I changed the dsn to take out my real name, etc. Oh, and the
CREATE statement was shortened so you did not need to read about all of the
fields I was creating which had no relevance to this question, and there
were times when I tried a create statement which did not contain a field
which was NOT NULL. Last, since Python is interactive (the >>> prompts
indicate that I was doing this from the command line) I actually tried over
a hundred different things. What I posted was reasonable example code which
did indeed not work, and which was the closest I could come in a short
amount of space to demonstraiting what I though might work, but which
didn't. It really does not work. It does not fail, however, due to some
problem other than my lack of understanding how the IDENTITY_INSERT command
works. That is to say, the NOT NULLness of a field, or the altered dsn does
not make my question more difficult to understand. I am sorry that my short
response did not elucidate this point more clearly.

Really, what I am looking for is an example of something that does work. I
have been unable to find one online.

So far, no one seems to think my code should work, but why is still a
mystery to me.

-d



Relevant Pages

  • Re: dbi not installing
    ... Paul Lalli wrote: ... just the command prompt. ... This is line 3 of your file, but your error message is saying it tried ... That was the real code, I just removed blank lines for readability. ...
    (perl.beginners)
  • Re: Mailmerge, querystring and (un)logical SQL (Word 2003)
    ... I have the following problem related to mailmerge, QueryString command ... In other words parentheses are ignored in this logic sentence and get ... Is there any way to force Word to accept the "parenthesis logic"? ... I am enclosing the part of my real code which is a subject of my ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Getting no error msg and no results
    ... If I type the single line of code into the command line it works. ... Nothing is deleted and there is no error msg. ... know I am looking at the real code. ...
    (comp.unix.programmer)
  • Re: Trying to Write a New Record
    ... Your Insert command is hard-wired to only insert one value. ... field size for real code. ... should also define the Update and Delete commands for proper operation. ... > FROM Sessions", Me.OleDbConnection1) ...
    (microsoft.public.dotnet.framework.adonet)
  • Mailmerge, querystring and (un)logical SQL (Word 2003)
    ... I have the following problem related to mailmerge, QueryString command ... In other words parentheses are ignored in this logic sentence and get ... Is there any way to force Word to accept the "parenthesis logic"? ... I am enclosing the part of my real code which is a subject of my ...
    (microsoft.public.word.mailmerge.fields)