Wednesday, March 21, 2012
Is it possible to conditionally skip steps in a job?
step?
For example I don’t want to run a step if the are no records in a table.
I also need to loop based on a condition.
Sounds like a DTS package is a better choice for this type of work.
Andrew J. Kelly SQL MVP
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
> failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>
|||Yes, you can... select the task. Right click and go to task properties ( I
could be mistaken and it might be in the workflow properties..) but you can
associate a script ( the button is on the lower left side of the dialog
box.)..
The script returns a value which indicates whether the step/task should run
or not...
Sorry I can't remember better details, and I only have Yukon installed on
this box...
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>
|||If this is with a job you can generate failure inside that step with
RAISERROR and then on job properties choose on failure go to the next step.
Other way with a job is to combine these 2 steps in one and make
a condition inside.
If this is a DTS go to the sqldts.com - there is a very good example
of skipping steps inside DTS package.
Regards.
"Dave" wrote:
> Is it possible to conditionally skip or jump steps in a job without failing a
> step?
> For example I don’t want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>
Is it possible to conditionally skip steps in a job?
a
step?
For example I don’t want to run a step if the are no records in a table.
I also need to loop based on a condition.Sounds like a DTS package is a better choice for this type of work.
Andrew J. Kelly SQL MVP
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
> failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>|||Yes, you can... select the task. Right click and go to task properties ( I
could be mistaken and it might be in the workflow properties..) but you can
associate a script ( the button is on the lower left side of the dialog
box.)..
The script returns a value which indicates whether the step/task should run
or not...
Sorry I can't remember better details, and I only have Yukon installed on
this box...
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>|||If this is with a job you can generate failure inside that step with
RAISERROR and then on job properties choose on failure go to the next step.
Other way with a job is to combine these 2 steps in one and make
a condition inside.
If this is a DTS go to the sqldts.com - there is a very good example
of skipping steps inside DTS package.
Regards.
"Dave" wrote:
> Is it possible to conditionally skip or jump steps in a job without failin
g a
> step?
> For example I don’t want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>
Is it possible to conditionally skip steps in a job?
step?
For example I donâ't want to run a step if the are no records in a table.
I also need to loop based on a condition.Sounds like a DTS package is a better choice for this type of work.
--
Andrew J. Kelly SQL MVP
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
> failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>|||Yes, you can... select the task. Right click and go to task properties ( I
could be mistaken and it might be in the workflow properties..) but you can
associate a script ( the button is on the lower left side of the dialog
box.)..
The script returns a value which indicates whether the step/task should run
or not...
Sorry I can't remember better details, and I only have Yukon installed on
this box...
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:742CC080-17BE-4885-AFF4-D5769DE1AC0E@.microsoft.com...
> Is it possible to conditionally skip or jump steps in a job without
failing a
> step?
> For example I don't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>|||If this is with a job you can generate failure inside that step with
RAISERROR and then on job properties choose on failure go to the next step.
Other way with a job is to combine these 2 steps in one and make
a condition inside.
If this is a DTS go to the sqldts.com - there is a very good example
of skipping steps inside DTS package.
Regards.
"Dave" wrote:
> Is it possible to conditionally skip or jump steps in a job without failing a
> step?
> For example I donâ't want to run a step if the are no records in a table.
> I also need to loop based on a condition.
>
Friday, February 24, 2012
is importing a dtsx file Necessary
Ok, I'm actually adding a SSIS job to my job agent on my test SQL server. Noticed that when I go to my job agent --> add new job, under the steps option, I click new. this then takes me to the new job step window. When I select
Type as SQL Server Integrated Services, I then see some new tabs at the bottom of the form. Under package source I can select File System, SQL Server, or SSIS Package Store, then I have to select the location of the dtsx file.
So my question is, since I can select the actual file (package) I want to run from here, do I really have to import a package to the file system or MSDB under the SQL Integration Services on the server?
It appears to me that its kind of the same thing.
I'm new to this SSIS, SQL DB work, so I'm learning as I go. . . .Yes, you do. If the file doesn't reside on the server, how will the agent job be able to find it?I believe that when you select filesystem in the Agent job step, it's showing you your local filesystem, not that of the server.
Monday, February 20, 2012
Is backup log truncate inactive part of logs?
backup database and then
backup logs
or reverse?
Thanks a lot,ZvonimirTo answer your subject line, the backup log command does nothing with the INACTIVE part of the log. It only truncates the active part, it does not shrink the logfile if that is what you are asking. A full backup does not truncate or shrink the log file so it depends on what your needs are in regards to doing a log backup before or after a full backup.
HTH|||rhigdon,
The active portion of the log can never be truncated. The active part represents transactions in progress. It is the inactive part that is truncated.
blindman|||"Active portion" may not have been the right term to use, you are right in saying Active TRANSACTIONS are transactions that have not been committed. So, not sure if we can call any PORTION of the log active, and would we call the remainder INACTIVE? Meaning the empty space of the footprint plus the transactions not checkpointed?
My definition of the active portion of the tran log in the context of this thread was the transactions that have not been checkpointed and sent to the database yet but were still in the tran log (and of course would show up in any query). Wheras (again, my definition) the inactive portion was the percentage not being used in the tran log.
Soo, not sure if active or inactive are the right terms but what I meant to relay was that if my tran log is 50mb with 20mb used, a backup or truncate log command would clear that 20mb but still leave the footprint or shell of 50mb until it was shrunk or grew more.
Thanks for pointing that out :)|||You are also right that active trans can not be truncated , forgot to add that.|||Thanks for Your answers.I believe i wasn't exact enough.
My experience with DB2 and Oracle tell me that for RDBMS common feature is "online backup",that is during backup my users can work with database.But,for recovery of database,only database online backup isn't enough,because of uncommited transactions in "active part of logs".So,for online backup I MUST do BACKUP LOG.
My qestions are:
1) How i force database to do online backup?Is this any reserved word for online backup telling "it is online backup" or SQL by "status of database" recognize online ( or offline) backup?
2) What is better:
a) BACKUP DATABASE
BACKUP LOG (with truncate,not shrink)
or
b) BACKUP LOG
BACKUP DATABASE?
Thanks a lot for Your answers,Zvonimir