Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run this?? 2

Status
Not open for further replies.

icemel

MIS
Oct 17, 2005
463
US
Hi,

I used a spreadsheet to create multiple lines of the same command but with different parameters.

For example:

sp_help_jobschedule @job_name = "job1"
sp_help_jobschedule @job_name = "job2"
sp_help_jobschedule @job_name = "job3"
etc

Now, I want to run these multiple lines in a query analyzer window. But, I am getting an error on line 2.

How can I get these statments to run one after another without running them one at a time? I want to output a list of information.

Thanks much
 
You can put GO between each line. You'll end up getting multiple recordset (1 for each command).

Alternatively, you could create a temp table with a structure that matches the data returned from sp_help_jobschedule and then do an Insert/exec on each line. Finally, you would want to select from the temp table.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
forgot about exec... must be getting senile in my old age

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top