Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Job History

Author  Topic 

zinkjo
Starting Member

4 Posts

Posted - 2004-03-02 : 19:00:29
Is there a way to read the job history for a particular sql job programmatically ? I have a WEB page that I want to display the history of a particular job for administrative purposes.

thanks for your ideas

John

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-02 : 19:06:20
msdb.dbo.sp_help_jobhistory will give you the job history. If you don't like the format, right your own stored procedure against msdb.dbo.sysjobhistory.

Tara
Go to Top of Page

zinkjo
Starting Member

4 Posts

Posted - 2004-03-02 : 19:42:53
quote:
Originally posted by tduggan

msdb.dbo.sp_help_jobhistory will give you the job history. If you don't like the format, right your own stored procedure against msdb.dbo.sysjobhistory.

Tara



Thanks Tara. That's exactly what I was looking for. Does MSDE support SQL Jobs ? I didn't see sysjobhistory on my msde version.

John
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-02 : 19:45:57
Yes MSDE does have this table and does support jobs. The table is in the msdb database.

Tara
Go to Top of Page

zinkjo
Starting Member

4 Posts

Posted - 2004-03-02 : 19:48:23
quote:
Originally posted by tduggan

Yes MSDE does have this table and does support jobs. The table is in the msdb database.

Tara



I am viewing the msdb database via the sql server explorer that comes with .Net. I don't see any system tables. Maybe there is a setting I am missing for showing system tables ?

John
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-02 : 19:53:06
If the tool is anything like Enterprise Manager, then you can right click on the server, edit the registration properties, and check the box that says to show the system tables.

You can also view the tables using osql in a cmd window:

osql -SServerName -E

1>use msdb
2>go
1>select * from sysjobhistory
2>go

Tara
Go to Top of Page

zinkjo
Starting Member

4 Posts

Posted - 2004-03-02 : 20:41:10
quote:
Originally posted by tduggan

If the tool is anything like Enterprise Manager, then you can right click on the server, edit the registration properties, and check the box that says to show the system tables.

You can also view the tables using osql in a cmd window:

osql -SServerName -E

1>use msdb
2>go
1>select * from sysjobhistory
2>go

Tara




Can I download enterprise manager for msde ? If yes, what is the url

John
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-03 : 12:19:57
No you can not. You must have a SQL license (MSDN subscription or CAL would do) to use the client tools.

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-03-03 : 23:04:05
Actually, you can download the trial version of SQL Server and install the client tools only. I've done this a few times and they've worked fine, even after the 120 day trial period ends (the server stops working, but EM and QA still do)
Go to Top of Page

nfsoft
Starting Member

36 Posts

Posted - 2004-03-04 : 04:47:44
Why dont you create a log table?
It's easy, fast and it's mbu (made by YOU)

something like
1st - (insert into log "logstart")
2nd - (Your job - hope is runnig a package )
3rd a) Return OK (insert into log "OK") ---
3rd a) Return KO (insert into log "KO") ---

Nuno Ferreira
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-04 : 12:08:55
quote:
Originally posted by robvolk

Actually, you can download the trial version of SQL Server and install the client tools only. I've done this a few times and they've worked fine, even after the 120 day trial period ends (the server stops working, but EM and QA still do)



Yeah, but are you really allowed to use them after the trial ends?

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-03-04 : 23:49:08
Yes I am, I'm an MVP dammit!

Seriously though, if you run the trial and it stops working after 120 days, EM and QA are pretty useless at that point. If you happen to use them to connect to ANOTHER server, one that is already licensed, then it's no different than if you installed the client tools from the licensed copy. It's literally impossible to use them in a way that violates the license unless you're also running an unlicensed server.

IANAL, but MS would have to be on drugs if they can find a reasonable argument (one they're actually willing to spend legal fees on) against that.
Go to Top of Page
   

- Advertisement -