Showing posts with label rows. Show all posts
Showing posts with label rows. Show all posts

Monday, March 12, 2012

Scheduled job executing Stored procedures fails

Hi,
I have 4 seperate stored procedures that if I run manually from Query
Analyzer work fine. Each one picks rows from a number of joined tables
depending on a date criteria. Each SP is exactly the same except for the
date ranges.
When they are run manually they do what I expect and I end up with 4 tables
each populated with a 1/2 dozen records.
However when I create a job in Enterprise Manager and add four steps into it
(one for each job) I end up with it creating four empty tables even though
two minutes ago I ran them manually and got what I expect and if I run them
manually after the scheduled job ran I get the correct results.
Each step says something like "Exec MoneyLaundering_21Days" and that's it.
The correct database is chosen in the top of the scheduled job dialogue box.
I've even tried scheduling a new job and just putting one SP into it but I
get the same result. I'm kinda at my wits end here so any assistance would
be much appreciated.
Regards,
Matt Lemon.Do you have the sp wrapped in a transaction that you are not committing?
Andrew J. Kelly SQL MVP
"news.esat.net" <matt.lemon@.williamfry.ie> wrote in message
news:dvttn9$cj4$1@.reader01.news.esat.net...
> Hi,
> I have 4 seperate stored procedures that if I run manually from Query
> Analyzer work fine. Each one picks rows from a number of joined tables
> depending on a date criteria. Each SP is exactly the same except for the
> date ranges.
> When they are run manually they do what I expect and I end up with 4
> tables each populated with a 1/2 dozen records.
> However when I create a job in Enterprise Manager and add four steps into
> it (one for each job) I end up with it creating four empty tables even
> though two minutes ago I ran them manually and got what I expect and if I
> run them manually after the scheduled job ran I get the correct results.
> Each step says something like "Exec MoneyLaundering_21Days" and that's it.
> The correct database is chosen in the top of the scheduled job dialogue
> box.
> I've even tried scheduling a new job and just putting one SP into it but I
> get the same result. I'm kinda at my wits end here so any assistance
> would be much appreciated.
> Regards,
> Matt Lemon.
>|||Did you look at error log? Have you tried profiler?
I assume, your procedures create tables AND populate them with some records
right?
Maybe the identity under which job is running doesn't have appropriate
credentials to populate tables?
Peter

scheduled dts return's 0 rows..

Hi all
After scheduling a dts, which retrieves data from a priority-tabula server
(using the tabula propriatary odbc driver) , no rows are transfared.
There is no error massage i can trace in sql server or in any of its logs,
the job just passes gracefully by the dts data transfare tasks, which all
return 0 rows..
If I execute the dts manually all is well...
Both the sql server and sqlserver agent user accounts are the domain
administrator.
Any idea will be greatly appriciated!
I've been fighting this phantom phenomena for a very l o n g time and still
have no clue.
Thank you
Rea
Rea,
to test if this is an authentication issue, can you log onto the SQL Server box as the same Domain user that the SQL Server Agent uses and then manually run the DTS package. This should be physically done on the server box. I'm expecting that this will re
turn zero records, but let's see... . If it doesn't return any rows, then try running the job manually as you reported in your first post and again log in as the SQL Server Agent's login. This will tell us if it is related to the existence of network shar
es etc.
HTH,
Paul Ibison

scheduled dts return's 0 rows..

Hi all
After scheduling a dts, which retrieves data from a priority-tabula server
(using the tabula propriatary odbc driver) , no rows are transfared.
There is no error massage i can trace in sql server or in any of its logs,
the job just passes gracefully by the dts data transfare tasks, which all
return 0 rows..
If I execute the dts manually all is well...
Both the sql server and sqlserver agent user accounts are the domain
administrator.
Any idea will be greatly appriciated!
I've been fighting this phantom phenomena for a very l o n g time and still
have no clue.
Thank you
ReaRea,
to test if this is an authentication issue, can you log onto the SQL Server
box as the same Domain user that the SQL Server Agent uses and then manually
run the DTS package. This should be physically done on the server box. I'm
expecting that this will re
turn zero records, but let's see... . If it doesn't return any rows, then tr
y running the job manually as you reported in your first post and again log
in as the SQL Server Agent's login. This will tell us if it is related to th
e existence of network shar
es etc.
HTH,
Paul Ibison

scheduled delete performance cost

What would be the performance cost if I deleted all the rows from a table in MSSQL every 5 minutes?

I'm doing this to keep track of whos online. Every time a user goes to a new page they get logged into a table called WhosOnline. Every 5 minutes the log will get deleted.

What would be the performance cost of this and if its high, does anyone know a better way to keep track of whos Online?Forget it, I figured out how to do it. SessionID & UserName in a database.