Results 1 to 2 of 2

Thread: Return GUID value Like @@IDENTITY

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Return GUID value Like @@IDENTITY

    Is there a way to return the equivalent of @@IDENTITY using a GUID?

    I need to insert data into a database in a parent/child format.

    I insert the parent information into the parent table like this
    Code:
    Parent Table
    PID (GUID) PK
    ParentName
    
    INSERT INTO tableName VALUES(newid(), '" & strParentName & "')
    Then I need to insert the child information into the childs table something like this
    Code:
    Child Table
    CID (GUID) PK
    PID (GUID) FK references ParentTable.PID
    ChildName
    
    INSERT INTO tableName VALUES(newid(), get GUID that was inserted in ParentTable.PID field, '" & childName & "')
    any ideas?
    Last edited by Memnoch1207; Oct 23rd, 2003 at 01:53 PM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width