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 can your reference Columns in a system Stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-11-07 : 09:22:35
rrober07 writes "I want to have a Stored procedure call another stored procedure gathering the info from some of the information SP#1 and use it calling SP#2...
For example sp_Help returns columns when executed (Name, Owner, Object_type).
So how can I reference the Name column and pass it to SP#2

Exec sp_Help

...?
SP#2 name=sp_help.Name ???


Thanks


Richard"

nr
SQLTeam MVY

12543 Posts

Posted - 2002-11-07 : 09:44:28
create a temp table - put thye results of sp_help into it and call sp2 for each row.

But also look at the information_schema views and sysobjects table as you may find this easier than sp_help.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -