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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to return value after insetion

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-14 : 10:42:23
Sukanya writes "Hi Experter,

I have one question with my task. I have constructed the stored procedure to insert values to my table and what I need is getting some values from table by selection the same table by the same insertion stored procedure. Is it possible to do this?
I don't want to create more stored procedures and I think it's better that it will access I/O just one time.

Best Regards,
Sukanya"

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-05-14 : 10:47:18
You can just do a select after the insert in the procedure:

set nocount on

insert blah
select asd from blah2

select asd from blah where id=whatever



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-05-14 : 11:07:57
Huh?

You INSERT with either a Values clause, in whuch case you have the values already, or a SELECT, in Which case you need to just perform the SELECT again..

am I missing something?



Brett

8-)
Go to Top of Page
   

- Advertisement -