Go Back   AnandTech Forums > Software > Programming

· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· AMD Video Cards
· Nvidia
· Displays
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Home and Garden
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals with Free Stuff/Contests
· Black Friday 2015
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions

Thread Tools
Old 10-28-2011, 02:26 PM   #1
Join Date: Apr 2006
Posts: 141
Default Linking sharepoint to a SQL Server job notification. Possible?

So I am kicking around an idea at work and before I bring it up to my boss and the sharepoint folks I want to know if it is even feasible.

Here is the scenario. We have some SQL server jobs that run nightly that load data in the database. At the moment in the morning if the jobs succeed we receive an e-mail stating this then we have to log into the sharepoint site and update the status of the load manually. Basically just stating the date and time the load completed and if it did.

Is there a way I can insert some code into the sharepoint site that will update automatically based upon a trigger of some sort from SQL Server?

Not sure if this is possible but any thoughts or links would be greatly appreciated.
JohnnyMCE is offline   Reply With Quote
Old 10-31-2011, 02:30 PM   #2
bunker's Avatar
Join Date: Apr 2001
Location: Lansing, MI
Posts: 10,579

If all your jobs are in a list in SharePoint you could use SSIS to get the status and run a Powershell script to update the list.

Don't ask me how to do it though, I just went and asked my Sharepoint guy for you
bunker is offline   Reply With Quote
Old 11-01-2011, 08:15 AM   #3
Diamond Member
KB's Avatar
Join Date: Nov 1999
Location: Maryland
Posts: 4,510

SQL Server code can call just about any other code out there, .Net, batch files, powershell, so this is entirely doable. The problems are that you may need enable these features in SQL Server, also debugging t-sql or SSIS isn't a lot of fun. If I were given this task I would create a query to fetch the completed times of each job from the MSDB (sysjob, sysjobhistory tables) database in sql server. I would then have sharepoint fetch this data into a spreadsheet or list.

Here is a sample script to get you started.
KB is offline   Reply With Quote
Old 12-06-2011, 01:28 PM   #4
Diamond Member
leeland's Avatar
Join Date: Dec 2000
Posts: 3,635

depending on the complexity of the process involved with updating this sharepoint site I would conceive you could do something along the lines of adding a step to your job.

The step could back end update the site in sharepoint...if this is as simple as flipping a flag it might not be that big of a deal.

To find out where the update is occurring when you are in the site, you could run a profile trace on the sql server to capture the t-sql commands that are occurring when you are making the changes on the front end.

Is this supported...probably not
Is this a good idea...probably not

However if the risk is deemed to be low and the update simple then I wouldn't totally crap on the idea.
leeland is offline   Reply With Quote
Old 02-18-2012, 01:14 AM   #5
Gunslinger08's Avatar
Join Date: Nov 2001
Posts: 13,236

I know this is way after the fact, but you can do it fairly simply. Add a new email address in Exchange for SharePoint to receive updates on. Have your nightly job also send the email to this address. You can mail enable lists in SharePoint. Do that for the status list and write/attach a new SPEmailEventReceiver that parses the email body and updates the list appropriately. This approach removes the need for and SQL changes such as registering .net assemblies and such, for triggers and procedures to call.
Gunslinger08 is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 06:57 AM.

Powered by vBulletin® Version 3.8.8 Alpha 1
Copyright ©2000 - 2016, vBulletin Solutions, Inc.