|
-
Apr 18th, 2015, 09:54 PM
#3
Thread Starter
Lively Member
Re: Getting the ID from an Inserted record created by connection.execute
Thank you for your reply. As I only want the ID in this case, SCOPE_IDENTITY would be fine. I believe that I add that to the end of my SQL Statement, so that would be like the following?
myconnection.Execute("INSERT INTO " & OriginalTable & " SELECT * FROM TempTable; Select Scope_Identity()")
But i dont understand is how to return the resultant value in my variable ID ?
Googling other sites I see some suggestions such as ID = CInt(myCommand.ExecuteScalar()), but I dont have the ExecuteScaler option on myconnection
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|