SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

pnpsql
Posting Yak Master

India
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

tbl_acc
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

sunitabeck
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  
 New 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.03 seconds. Powered By: Snitz Forums 2000