Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update values in session
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

246 Posts

Posted - 11/05/2012 :  08:49:14  Show Profile  Reply with Quote

i have program a program "pr_acc"that inserts some values in table

id name amount date
1 aa 10 '05-nov-2012'
2 ab 11 '05-nov-2012'
3 ac 14 '05-nov-2012'
4 ax 19 '05-nov-2012'

now i need to call this program from another program and
when the inner program is complete i need to update the values in rows that are
inserted in current session.

the "pr_acc" is also called from some where else may be at same time.

challenge everything

Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/05/2012 :  11:56:07  Show Profile  Reply with Quote
If you have the ability to modify the "pr_acc" program, you can change it so it returns the Id's inserted and then use those id's to identify the rows that need to be updated.

If the ID's are auto-generated (IDENTITY), and if you are using SQL 2008 or later, you can use the OUTPUT clause when you insert to return the ID's inserted.

I know these are vague answers - if you can post more details on how you are doing the inserts, people on the forum may be able to offer more specific suggestions.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000