File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using SQL Server @@IDENTITY

 
Ian Morris
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please can somebody help with the following question. I am working on a JSP/Servlet application, my servlet inserts a record into a table with an identity column(SQL Server 7). How can I do a "select @@IDENTITY" to see what the last identity inserted was. I would like to capture the identity and display it back using a JSP. Thanks.
------------------
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you write a procedure call to do it you can return it as a result at the end in either a parm out field or a select result like ....

.
.
.
ret_id = @@identity
select ret_id
return
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic