sql server作业输出文件 - 将其传递到第二步 [英] sql server job output file -passing it onto second step

查看:80
本文介绍了sql server作业输出文件 - 将其传递到第二步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何将step1输出文件传递给同一作业的step2?我想b
$ b想知道当前作业的输出文件是什么,

而不是硬编码。任何idaes将不胜感激。


谢谢

How do we pass on the step1 output file to step2 of the same job? I
would like to know the current job''s output file programmetically,
instead of hard coding it. Any idaes would be appreciated.

Thanks

推荐答案

如果你有帮助可以解释你在每个步骤中所做的事情。如果这些步骤调用存储的proc / dts等...你知道

输出文件名吗?如果是这样,很容易将它们作为输入参数传递给该作业。需要更多关于你想要实现什么的信息

这里....

It would be helpfull if you can explain what you are doing in each
step. If these steps are calling a stored proc/dts ect... do you know
the output file name ? If so, its easy to pass them as input parameters
to that job. Need more info on what you are trying to acomplish
here....


tram(tr **** @ hotmail.com)写道:
tram (tr****@hotmail.com) writes:
我们如何将step1输出文件传递给同一作业的step2?我想知道当前作业的输出文件,而不是硬编码。任何idaes将不胜感激。
How do we pass on the step1 output file to step2 of the same job? I
would like to know the current job''s output file programmetically,
instead of hard coding it. Any idaes would be appreciated.




它似乎在msdb.dbo.sysjobsteps.output_file中。你也可以用
调用sp_help_jobstep从那里获取数据。

-

Erland Sommarskog,SQL Server MVP, es **** @ sommarskog.se


SQL Server SP3的联机书籍
< a rel =nofollowhref =http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asptarget =_ blank> http://www.microsoft.com/sql/techinf ... 2000 / books.asp


我不完全理解你的问题。这就是我认为你的意思

意思是:Job1运行一个脚本(或单个查询)来生成命令

语句。 Job2运行Job1的输出。


一种方法是使用isql.exe命令行开关

(查询分析器)。在线搜索书籍中的ISQL以查看完整的

开关列表。


使用-o指定输出文件。

使用-i指定输入。


Job1'的输出文件是Job2s输入文件。


另一种生成方式sql,然后运行它,就是使用sp_executesql

存储过程。编码可能会变得相当丑陋和复杂,如果你必须设置游标,则需要b $ b。有时isql命令行是一个简单的

快速而肮脏的解决方案。


希望这就是你的目的。


Dave


tram写道:
I don''t completely understand your question. Here''s what I think you
mean: Job1 runs a script (or single query) that generates command
statements. Job2 runs the output from Job1.

One way to do this is use use the command line switches of the isql.exe
(query analyzer). Search for ISQL in books online to see a complete
list of the switches.

use -o to specify an output file.
use -i to specify an input.

Job1''s output file would be Job2s input file.

Another way to generate sql, then run it, is to use the sp_executesql
stored procedure. The coding for this can get rather ugly and complex,
if you have to setup cursors. Sometimes isql command line is a simple
quick and dirty solution.

Hope this is what you were for.

Dave

tram wrote:
我们如何将step1输出文件传递给同一工作的step2?我想知道当前作业的输出文件,而不是硬编码。任何idaes将不胜感激。

谢谢
How do we pass on the step1 output file to step2 of the same job? I
would like to know the current job''s output file programmetically,
instead of hard coding it. Any idaes would be appreciated.

Thanks






这篇关于sql server作业输出文件 - 将其传递到第二步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆