Q
Problem solve Get help with specific problems with your technologies, process and projects.

Returning submitted info and table ID on a confirmation page

I have a form that will post information to an SQL database table. When I submit the information, a confirmation page comes up with the information that was submitted from the form. How can I get the confirmation page to return that information plus the ID number from the table?

You have to retrieve that data during your transaction. If you are using an identity, the ID just generated will be contained in the global variable @@identity. This is a scalar variable and as such only contains the last identity value generated within that connection. So, if you are inserting into multiple tables with identities, you will have to store each one separately.

 

For More Information

Dig Deeper on Microsoft SQL Server Installation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close