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 fetch records one by one by exec procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-26 : 07:52:58
dips writes "can write like this :]

create proc proc_name
as

declare op_cursor cursor for exec proc1 'name','code'
open op_cursor
.
.
."

nfsoft
Starting Member

36 Posts

Posted - 2004-02-26 : 09:07:44
Changes in database context last only until the end of the EXECUTE statement. For example, after the EXEC in this example, the database context is master:

USE master EXEC ("USE pubs") SELECT * FROM authors

This means there will be a problem because EXECUTE runs in another scope.
The same appends in your question.
I think it can be resolved by using de tempdb database (insert into #aux) but I still have to resolve something...!?



Nuno Ferreira
Go to Top of Page
   

- Advertisement -