Friday, March 30, 2012

Linking Scheduled Jobs

I currently have 4 scheduled jobs which are all scheduled for 4
different days and was wondering if there was anyway these could be be
stopped automatically in the event of a job failure, consider the
example below

Monday
Job runs to produce a file requesting BACS Payments.

Wednesday
Job runs to create a file that can be used to allocate the money
recieved from the bacs payment to a particular service.

If the job that runs on monday fails it would be nice for the job that
is due to run on wednesday to be automatically suspended but I can't
find anyway for this to be done.

Any help in this problem would be appreciated

Stuart FergusonStuart Ferguson wrote:
> I currently have 4 scheduled jobs which are all scheduled for 4
> different days and was wondering if there was anyway these could be be
> stopped automatically in the event of a job failure, consider the
> example below
> Monday
> Job runs to produce a file requesting BACS Payments.
> Wednesday
> Job runs to create a file that can be used to allocate the money
> recieved from the bacs payment to a particular service.
> If the job that runs on monday fails it would be nice for the job that
> is due to run on wednesday to be automatically suspended but I can't
> find anyway for this to be done.
> Any help in this problem would be appreciated
> Stuart Ferguson

I'm not sure if there is a way to do exactly what you want, but you
could do a workaround by creating a table that holds some value to
indicate a successful job. The first part of the Wed. job could be to
check the value of that table, if it isn't what it is supposed to be, it
can terminate.

For example:

CREATE TABLE Job_Status (Completed DATETIME NOT NULL)

Monday's Job:

TRUNCATE TABLE Job_Status
-- Run Monday's job
As last step of Monday's job:
INSERT INTO Job_Status (Completed) VALUES (CURRENT_TIMESTAMP)

Wednesday's Job:

IF EXISTS (SELECT * FROM Job_Status)
-- Do Job

If you wanted to get fancy you could make the code more complex to check
for job history and keep a record of when jobs fail or not, etc.

Zach|||Stuart Ferguson (stuart_ferguson1@.btinternet.com) writes:
> I currently have 4 scheduled jobs which are all scheduled for 4
> different days and was wondering if there was anyway these could be be
> stopped automatically in the event of a job failure, consider the
> example below
> Monday
> Job runs to produce a file requesting BACS Payments.
> Wednesday
> Job runs to create a file that can be used to allocate the money
> recieved from the bacs payment to a particular service.
> If the job that runs on monday fails it would be nice for the job that
> is due to run on wednesday to be automatically suspended but I can't
> find anyway for this to be done.

As Zach says, you would somehow implement some sort of your own buisness
logic.

One way, would have two extra steps in the Monday job. When step 1 succeeds,
the job should proceed to step 2 which enable the job for Wednesday. When
the step fails, the should proceed to step 3 to disable the Wednesday.

To enable/disable jobs, you would have to use the job-control stored
procedures that are described in Books Online.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Linking SAS-datasets to an Access Project 2003

I installed the SAS ODBC-driver 9.1 and can choose the SAS tables (datasets)
but then I get this message:
"Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access
this provider through a linked server."
Linked server?
What do I do? Is it possible to link SAS datasets to an Access Project or to
SQL Server 2000?
By definition, Access Projects are a presentation layer that store all
their data in a SQL Server backend. You should simply point SAS to the
real SQL backend database
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

Linking SAS-datasets to an Access Project 2003

I installed the SAS ODBC-driver 9.1 and can choose the SAS tables (datasets)
but then I get this message:
"Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access
this provider through a linked server."
Linked server?
What do I do? Is it possible to link SAS datasets to an Access Project or to
SQL Server 2000?By definition, Access Projects are a presentation layer that store all
their data in a SQL Server backend. You should simply point SAS to the
real SQL backend database
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbellsql

Linking same table

I have a table that looks like this:
Acct Reason
1 MA01
1 MA18
1 MA19
2 MA01
2 MA03
3 MA01
3 MA03
3 MA07
4 MA01
4 MA03
In the above example, if an account has a MA18 or MA07, I DO NOT want the
account. Therefore, the resulting data would be account 2 and 4.
The above table needs to be a parent table (i.e. demographic table and
orders would be a child tables).
How do I create a SQL statement that returns any account that DOES NOT have
a MA18 or MA07? Do I create a view? This is way over my head.
THANKS,
MEGSelect * from account a1
where not exists (select * from account a2 where a1.acct = a2.acct and
(a2.Reason = 'MA18' or a2.Reason = 'MA07'))
Daniel
"MEG" <MEG@.discussions.microsoft.com> a crit dans le message de
news:054DD409-4897-414F-A175-E0084428547B@.microsoft.com...
> I have a table that looks like this:
> Acct Reason
> 1 MA01
> 1 MA18
> 1 MA19
> 2 MA01
> 2 MA03
> 3 MA01
> 3 MA03
> 3 MA07
> 4 MA01
> 4 MA03
> In the above example, if an account has a MA18 or MA07, I DO NOT want the
> account. Therefore, the resulting data would be account 2 and 4.
> The above table needs to be a parent table (i.e. demographic table and
> orders would be a child tables).
> How do I create a SQL statement that returns any account that DOES NOT
have
> a MA18 or MA07? Do I create a view? This is way over my head.
> THANKS,
> MEG|||SELECT *
FROM Table O
WHERE NOT EXISTS( SELECT 1 FROM Table T
WHERE T.Acct = O.acct
AND T.Reason IN('MA18','MA07'))
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"MEG" <MEG@.discussions.microsoft.com> wrote in message
news:054DD409-4897-414F-A175-E0084428547B@.microsoft.com...
>I have a table that looks like this:
> Acct Reason
> 1 MA01
> 1 MA18
> 1 MA19
> 2 MA01
> 2 MA03
> 3 MA01
> 3 MA03
> 3 MA07
> 4 MA01
> 4 MA03
> In the above example, if an account has a MA18 or MA07, I DO NOT want the
> account. Therefore, the resulting data would be account 2 and 4.
> The above table needs to be a parent table (i.e. demographic table and
> orders would be a child tables).
> How do I create a SQL statement that returns any account that DOES NOT
> have
> a MA18 or MA07? Do I create a view? This is way over my head.
> THANKS,
> MEG|||A table can join to an aliased version of itself.
"MEG" <MEG@.discussions.microsoft.com> wrote in message
news:054DD409-4897-414F-A175-E0084428547B@.microsoft.com...
> I have a table that looks like this:
> Acct Reason
> 1 MA01
> 1 MA18
> 1 MA19
> 2 MA01
> 2 MA03
> 3 MA01
> 3 MA03
> 3 MA07
> 4 MA01
> 4 MA03
> In the above example, if an account has a MA18 or MA07, I DO NOT want the
> account. Therefore, the resulting data would be account 2 and 4.
> The above table needs to be a parent table (i.e. demographic table and
> orders would be a child tables).
> How do I create a SQL statement that returns any account that DOES NOT
have
> a MA18 or MA07? Do I create a view? This is way over my head.
> THANKS,
> MEG|||"MEG" <MEG@.discussions.microsoft.com> wrote in message
news:054DD409-4897-414F-A175-E0084428547B@.microsoft.com...
> I have a table that looks like this:
> Acct Reason
> 1 MA01
> 1 MA18
> 1 MA19
> 2 MA01
> 2 MA03
> 3 MA01
> 3 MA03
> 3 MA07
> 4 MA01
> 4 MA03
> In the above example, if an account has a MA18 or MA07, I DO NOT want the
> account. Therefore, the resulting data would be account 2 and 4.
Something like (untested):
SELECT DISTINCT Acct
FROM AcctTable
WHERE NOT EXISTS (SELECT * FROM AcctTable WHERE reason IN ('MA18','MA07'))
Good Luck,
Jim|||Is a VIEW and an ALIAS similiar other than a VIEW being stored and an ALIAS
created on the fly?
I am using Crystal Reports so I don't think I can create something on the fl
y.
THANKS,
MEG
"JohnnyAppleseed" wrote:

> A table can join to an aliased version of itself.
> "MEG" <MEG@.discussions.microsoft.com> wrote in message
> news:054DD409-4897-414F-A175-E0084428547B@.microsoft.com...
> have
>
>|||A table referenced in a query can be reassigned a new name.
For example select ... from MyTable as MT ..
I'm calling this a table alias. A view is just a method to store a query in
SQL Server, and it can contain a query with an alias, but not necessarily.
Below is a query I wrote for another guy this morning. In it he is wanting
to self join a table called [offline] back to itself and list those records
that exist for 2004 but not 2005. Notice that [offline] is left joined to
[offline] and each is referenced using a different alias (B04 vs. B05).
select
B04.booking_year,
B04.category1,
B04.category2
from
offline as B04
left join
offline as B05
on B05.booking_year = 2005 and
B05.category1 = B04.category1 and
B05.category2 = B04.category 2
where
B04.booking_year = 2004 and
B05.id is NULL
When using Crystal Reports, I highly reccomend that you store your queries
in a View or Stored Procedure, making them easier to manage and re-use
across report templates. There is nothing uglier than a project with two
dozen CR templates and each one has a slightly version of the same query.
"MEG" <MEG@.discussions.microsoft.com> wrote in message
news:913DD957-E0B3-4592-8FA4-CA3A2EEE92E3@.microsoft.com...
> Is a VIEW and an ALIAS similiar other than a VIEW being stored and an
ALIAS
> created on the fly?
> I am using Crystal Reports so I don't think I can create something on the
fly.
> THANKS,
> MEG
> "JohnnyAppleseed" wrote:
>
the|||Your reply was very beneficial. I agree that the view/stored procedure is
the best method.
In Crystal Reports, I don't know how to pass a parameter to the view/stored
procedure (i.e. in your example if you wanted to have a parameter for 2004
and one for 2005).
Any thoughts?
THANKS,
MEG
"JohnnyAppleseed" wrote:

> A table referenced in a query can be reassigned a new name.
> For example select ... from MyTable as MT ..
> I'm calling this a table alias. A view is just a method to store a query i
n
> SQL Server, and it can contain a query with an alias, but not necessarily.
> Below is a query I wrote for another guy this morning. In it he is wanting
> to self join a table called [offline] back to itself and list those records
> that exist for 2004 but not 2005. Notice that [offline] is left joined to
> [offline] and each is referenced using a different alias (B04 vs. B05).
> select
> B04.booking_year,
> B04.category1,
> B04.category2
> from
> offline as B04
> left join
> offline as B05
> on B05.booking_year = 2005 and
> B05.category1 = B04.category1 and
> B05.category2 = B04.category 2
> where
> B04.booking_year = 2004 and
> B05.id is NULL
> When using Crystal Reports, I highly reccomend that you store your queries
> in a View or Stored Procedure, making them easier to manage and re-use
> across report templates. There is nothing uglier than a project with two
> dozen CR templates and each one has a slightly version of the same query.
> "MEG" <MEG@.discussions.microsoft.com> wrote in message
> news:913DD957-E0B3-4592-8FA4-CA3A2EEE92E3@.microsoft.com...
> ALIAS
> fly.
> the
>
>|||Calling a SP or paramaterized view from a CR template is cumbersome. When I
worked with CR 8.5 and VB 6.0, I would define an external ADO Recordset,
load the recordset with data, and then bind the recordset to the report
design object. This also involves building a .TTX file that has the same
data structure as your recordset, and then binding the data source of the
template to that TTX file. It sounds complicated, but it's actually less
troublesome once you get everything setup. Using deja.com, search in the
*crystal* newsgroups for keyword "TTX", and you will find several
discussions. Also there are examples on the http://www.businessobjects.com/
support website.
"MEG" <MEG@.discussions.microsoft.com> wrote in message
news:0186A86C-82C3-4359-BF93-73FE1262CF02@.microsoft.com...
> Your reply was very beneficial. I agree that the view/stored procedure is
> the best method.
> In Crystal Reports, I don't know how to pass a parameter to the
view/stored
> procedure (i.e. in your example if you wanted to have a parameter for 2004
> and one for 2005).
> Any thoughts?
> THANKS,
> MEG
> "JohnnyAppleseed" wrote:
>
in
necessarily.
wanting
records
to
queries
query.
the
want
and
NOT

Linking Reports in different projects

Is there a way to link reports from one project to reports in a second
project?You do this from report manager. Open up the properties of the report you
want to create a linked report of and then specify the location the linked
report should go in.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"sfibich" <sfibich@.pfgc.com> wrote in message
news:eQM9U%2334EHA.1692@.TK2MSFTNGP10.phx.gbl...
> Is there a way to link reports from one project to reports in a second
> project?|||Bruce L-C [MVP] wrote:
> You do this from report manager. Open up the properties of the report you
> want to create a linked report of and then specify the location the linked
> report should go in.
>
But this does not work when reports are in different projects or is
there something I am missing?|||The way it works for me is each project is a directory on the web server. If
I have a project/directory that I want the same report to show in both then
from report manager (not from the IDE, you can not do this from within VS)
follow the directions I gave you below. Try one, it will make sense once you
do one.
"sfibich" <sfibich@.pfgc.com> wrote in message
news:ugXBpP44EHA.1564@.TK2MSFTNGP09.phx.gbl...
> Bruce L-C [MVP] wrote:
> > You do this from report manager. Open up the properties of the report
you
> > want to create a linked report of and then specify the location the
linked
> > report should go in.
> >
> But this does not work when reports are in different projects or is
> there something I am missing?|||Bruce L-C [MVP] wrote:
> The way it works for me is each project is a directory on the web server. If
> I have a project/directory that I want the same report to show in both then
> from report manager (not from the IDE, you can not do this from within VS)
> follow the directions I gave you below. Try one, it will make sense once you
> do one.
>
> "sfibich" <sfibich@.pfgc.com> wrote in message
> news:ugXBpP44EHA.1564@.TK2MSFTNGP09.phx.gbl...
>>Bruce L-C [MVP] wrote:
>>
>>You do this from report manager. Open up the properties of the report
> you
>>want to create a linked report of and then specify the location the
> linked
>>report should go in.
>>
>>But this does not work when reports are in different projects or is
>>there something I am missing?
>
>
Oh, now I see. Sorry I was so thick headed about this. This is going
to be a nightmare for me as I have many reports that need to be in sub
projects because of security reasons but most reports in one level need
to link down to the next level.
Thanks agian for you help.|||If I'm just creating a link from a textbox, I simply use the URL option of
the action property of the textbox to link to the report. You may still have
some security issues, but it works well for me.
"sfibich" wrote:
> Is there a way to link reports from one project to reports in a second
> project?
>

Linking reports

Does anyone know if it is possible to link two reports together?
For example, if you have a report showing customers with the number of
orders they have placed, can you then link to another report showing
details of the actual orders.
Hope this makes sense.
ChrisYes possible using drill through reports.
Amarnath
"chris.j.stubbs@.gmail.com" wrote:
> Does anyone know if it is possible to link two reports together?
> For example, if you have a report showing customers with the number of
> orders they have placed, can you then link to another report showing
> details of the actual orders.
> Hope this makes sense.
> Chris
>

Linking reports

Hello,
I am currently working on a project that involves tracking progress over several months. So, for the month of July, I need to show the results of June, May, etc. The easiest way I can think of doing this is to "connect" to the previous month's report. Can this be done? The only other options I can think of are:
A. have my July month recalculate all the values to the beginning of the year.
B. create an new table in my DB that will store the carry-over variables from the months before.
Any input would be appreciated.
No, you should make a query which give you all the summarized data. Then organize them into the report. And put a link in each month column to jump to the detailed report of the selected month.

The best solution is to design cubes and obtain data from it.