Advertisement

06.30.2008 at 09:13AM PDT, ID: 23527391
[x]
Attachment Details

Apply table to System stored procedure

Asked by sqlconsumer in MS SQL Server

Hi,

Is there a way of applying the contents of a table as paramters to a system stored procedure?

For Instance if I use the code....

SELECT sd.name FROM sys.databases sd
INNER JOIN
sys.syslogins sl
ON sd.owner_sid = sl.sid
WHERE sl.name <> 'sa'

I can produce a table that contians all user database. Now I want to be able to execute the SP master.dbo.sp_addumpdevice on each of the databases in the table.

How can I do this without using cursors? or loops? is it possible?Start Free Trial
[+][-]06.30.2008 at 09:27AM PDT, ID: 21900579

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 02:39AM PDT, ID: 21906075

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 06:16AM PDT, ID: 21907461

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 1
Solution Grade: C
 
 
[+][-]07.01.2008 at 06:19AM PDT, ID: 21907488

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 06:21AM PDT, ID: 21907507

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628