Search Result

Collapse
2 results in 0.0039 seconds.
Keywords
Members
Tags
@@identity
  •  

  • StevieMars
    started a topic Multiple Inserts

    Multiple Inserts

    Hello,

    I want to do two sql INSERTS into the same table (table holds pk and fk rows) but I need the second insert to use the new Identity from the first INSERT. Something like:

    Code:
    INSERT INTO [table]
    SELECT [Cols] FROM [Table] Where [blah];SELECT NewUDValue AS @@IDENTITY;
    UNION ALL
    SELECT [colName = NewUDValue, more cols] FROM [Tablle] Where [Blah]
    However this doesn't work! Is this...
    See more | Go to post

  • cgiguere
    started a topic Insert to SQLExpress table

    Insert to SQLExpress table

    Hello,

    Trying to just insert a simple record in DB and it fails. When I set debugger on, I see that execution jumps out by IntakeNummer to the Catch and of course, assigns value -1 to IntakeNummer. As if it was impossible to increment or even read de identity column! In my DB, IntakeID is my identity column (1,1).

    Underneath the vb.net code that fails. Can anyone help me? What am I doing wrong?

    ---------------------------------------------------------------...
    See more | Go to post
    Last edited by Frinavale; May 25 '09, 09:02 PM. Reason: Added code tags. Please post code in [code] [/code] tags.
Working...