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)
 Recordset handling in SP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-31 : 10:27:33
Shumaila writes "I know we can retrive and insert rows (Recordset) from two differnt tables inside a stored procedure but is it possible to move through those record and perform some calculation before inserting into the other table. (I need it because i am doing some calculation and want to use if else statements). Is it possible? I need to do it within a store procedure. I don;t have any front end (client) for that.

The query for retrieving and inserting witin the same sp into two different tables is


CREATE TABLE #Authors (au_id char(11))

INSERT #Authors
EXEC GetStateAuthors @State='UT'

SELECT *
FROM #Authors

DROP TABLE #Authors

CREATE PROCEDURE GetStateAuthors ( @State char(2) )
AS
SELECT au_id
FROM authors
WHERE State = @State
go


I have taken this example from graz article http://www.sqlteam.com/item.asp?ItemID=2644"
   

- Advertisement -