Delete All Jobs Except 2?

Using something that would work in 2005 and 2008, I am trying to
figure out how to delete all jobs except for two. Some runaway scripts
have added 40+ crazy-named jobs, and I need to get rid of them all,
but keep just two. Can anyone point me to the right queries to capture
all jobs into a table var or something better?

Thanks.

0
SnapDive
3/8/2010 8:46:02 PM
sqlserver.programming 1873 articles. 0 followers. Follow

2 Replies
673 Views

Similar Articles

[PageSpeed] 6

Select * FROM   msdb.dbo.sysjobs ~ List  all jobs including Job_id

In a cursor or loop		
Delete  msdb.dbo.sysjobs where Job_Id = 

HTH
-- 
RJ Roberts
DB Architect/Developer


"SnapDive" wrote:

> Using something that would work in 2005 and 2008, I am trying to
> figure out how to delete all jobs except for two. Some runaway scripts
> have added 40+ crazy-named jobs, and I need to get rid of them all,
> but keep just two. Can anyone point me to the right queries to capture
> all jobs into a table var or something better?
> 
> Thanks.
> 
> .
> 
0
Utf
3/8/2010 9:39:01 PM
Done. Thanks!
On Mon, 8 Mar 2010 13:39:01 -0800, RJ Roberts
<RJRoberts@discussions.microsoft.com> wrote:

>Select * FROM   msdb.dbo.sysjobs ~ List  all jobs including Job_id
>
>In a cursor or loop		
>Delete  msdb.dbo.sysjobs where Job_Id = 
>
>HTH

0
SnapDive
3/9/2010 2:20:27 PM
Reply:

Similar Artilces:

Help with columns #2
Hi How do I create a worksheet with just 3 columns (A, B, C...) rather than thousands (AA, BB, CC...)? Thanks! Hi - first there's a maximum of 256 columns :-) - You can only use these 3 columns (you can't delete the other columns) - if you like you can hide the other columns. Just select theses columns and goto 'Format - columns - Hide' -- Regards Frank Kabel Frankfurt, Germany Rich wrote: > Hi > > How do I create a worksheet with just 3 columns (A, B, C...) rather > than thousands (AA, BB, CC...)? > > Thanks! See one answer in m.p.e.newusers Please d...

Problems with creating a newsletter
I chose the form "Newsletter - email". I have created a 3 page newsletter. Now, I have NO IDEA how to send it out as an email. I do not want to send it as an attachment. I cannot figure out which "save as" format or what I need to do so that i can email this newsletter. Is there a website that goes through how to do this? Am I correct when I say that it has to be html in order for me to send it as email? That is not one of the options. Any help you give me would be greatly appreciated. Thank you, Markis www.adreamforabetterworld.com ...

Meeting updates #2
My users cannot update meetings created when they were on the old email server. I have noticed that the old string is still mapped to the meeting. e.g x400;c=us;a= ;p=Org name;o=exchagne;s=Lastname;g=firstname; Take a look at the following article: 275134 XADM: Cannot Reply to Messages That Are Sent from a User Account That http://support.microsoft.com/?id=275134 The same thing applies to meetings. How did you move them and what version(s) of Exchange? Thanks, Richard Roddy Microsoft Exchange Support This posting is provided "AS IS" with no warranties, and confers no ri...

Changing SQL Server for CRM 1.2
As my SQL server is currently on its last breath I am in the process of moving our CRM 1.2 databases to a new dedicated serever. I have detatched the databases from the old server, copied the files to the server and attached them. I have then gone into CRM deployment manager and changed to the SQL server to the new server. That all appears to work fine, no error messages. But when users try to access the CRM system they get an error and the CRM server event log fills with error messages. A few are listed below: dmLog: Failed to execute the SQL batch in the file sqlbatch.sql. MSCRM P...

How do you turn off/on the "1" or "2" or "+" or "-" view hide/unh.
What is or how do you control, turn on/off the small "1" "2" or "+" "-" hide/unhide view buttons right above the "A" cell? Sometimes shows when I hide columns. Hi 'Data - Goup/Outline' -- Regards Frank Kabel Frankfurt, Germany Seth wrote: > What is or how do you control, turn on/off the small "1" "2" or "+" > "-" hide/unhide view buttons right above the "A" cell? Sometimes > shows when I hide columns. You can toggle them to hide or display with <Ctrl> <8> Usi...

CFile (delete file)
How can I delete all files that end with ".temp" in some folder? CFile::Remove remove unlink -- cheers, Alok Gupta Blogs: http://wdevs.com/thatsalok "Petar Popara" <my.fake@mail.net> wrote in message news:Op6#URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > > How can I delete all files that end with ".temp" in some folder? > > SHFileOperation() will and it supports wildcards! DeleteFile() will operate on one file at a time. "Petar Popara" <my.fake@mail.net> wrote in message news:Op6%23URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > >...

Steps to Share Outlook on 2 different drives
This is a problem created by a dual boot of XPPSP2 on one drive C:\ and Vista on another drive E:\ that I use to format for new builds of Vista on the same box. I want to take my Outlook 2003 in box and folders on two different drives on one box and combine them so that all the emails go to one account and all the folders can be shared or used on each drive. I want to do the same with Outlook Express as well, and since this is an *Outlook newsgroup, I'll just take what I learn here and apply it to the ..dbx folder(s) in it. The idea is to receive email on both drives in one in one...

printing 2 charts on single page
Using Excel 2k, Win 2k I was trying to print to line charts on a single page to demonstrate the corelation between the two data sets. I would like to print in portait mode with one chart on top of page and one on bottom. Excel only seems to offer putting chart 2 on a separate page or embedding it in chart one. I am not very familiar with excel charting capabilites can anyone suggest a resorce? Thanks ...

Wrong message with cascading deletes
A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. When I delete a person all related Activity records are deleted which is to be expected. According to http://www.informit.com/articles/article.aspx?p=26115&seqNum=5 I should get the following message in this case: "Relationships that specify cascading deletes are about to cause 1 record(s) in this table and in related tables to be deleted. Are you sure you want to delete these records?" In stead I get: &quo...

#Delete Mark in Bound Memo filed
I have form that has bound memo field, sometime, no sure how it happen, the memo filed is filled with #Delete. My application is a stand alone program. Kindly advise what can cause this and how to avoid it from happening. -- TS Lim When was the last time you performed a compact and repair? Is you db split? Does each user have their own copy of the front-end? Please checkout http://www.granite.ab.ca/access/corruptmdbs.htm http://www.granite.ab.ca/access/corruption/symptoms.htm http://office.microsoft.com/en-ca/access/HA011865661033.aspx - No very helpful but directly from MS ...

Offline folder problems #2
Hi Guys, Basically I installed Outlook 97 on my office PC which is connect to microsoft exchange server. For some reason all of my messages were copied into offline folders, this causes a problem, whenever I open up outlook I get this message. Upload of offline changes could not be completed you do not have sufficient permission to perform this operation on this object. See the folder contact or see your system administrator. I do not administrator access on my user profile, every time I open outlook it resets everything I have changed (view etc) and gives that error message. How ...

Need Help with Deleting Empty Paragraphs in Word 2003
I have written the code below to delete all empty paragraphs at the end of a document and then place the cursor at the end of the last paragraph. It works fine as a stand alone sub in a new doc, but fails inside the real document that contains other code that manipulates several documents. The failure is that it will delete the last empty para, but then gets stuck looping inside the While...Wend because subsequent .Delete are not happening. So, the question is why would this work in one document, but then fail in another? n = 0 ...

Corrupt "Deleted Items" folder
I am unable to empty the "Deleted Items" folder. The error that comes up tells me that the "Outlook.pst" file has errors in it and to use the "Repair Inbox Tool". I've tried using the repair function under the "help" menu...to no avail. I have also tried opening the "Outlook.pst" file in MS Word, but the file is 129 megabytes! It crashes MS Word when I try to open it. Any ideas? Look for scanpst.exe on your local drive and run it against your outlook.pst file >-----Original Message----- >I am unable to empty the "Del...

Receiving Transaction Entry #2
I went into Receiving Transaction Entry to record the receipt of an item. The invoiced price did not agree with the purchase order. I had to add Shipping and adjust the provincial tax. I went to the proper screen to over-ride the calculated tax and the system told me that I couldn't do that because I had not filled in all the BOLD, RED areas. At that point I wanted to close down that screen, but the system would not let me do that either. I could minimize the screen and then I could also see that there wasn't any required information that had not be entered. The only way I c...

Opening pub files created with older Publisher versions #2
I have just upgraded to Publisher 2003 from 2000 and am having trouble with pub files sent to me for our chuch newsletter which is using Publisher 97 The text is not wrapping around graphics boxes. Can I fix this? I really don't want to go back to Pub 200 Thank Richard this is caused by Publisher 97 not been printer independent. Even if you went back to Publisher 2000, unless you have the identical font versions and printer driver you would have issues with formatting. It sounds like the person sending you the file has a garbage HP inkjet printer. Get them to install the HP5P laser p...

Associating Multiple Existing Contacts to an Account, Until CRM 2.x
I have racked my pea-sized brain for endless days for a way to associate multiple existing contacts (or accounts) to an account. My client has accounts that have many contacts (or accounts) involved at different stages of acquiring a new account. The logical method would be to add a custom attribute with lookup functionality into the existing CRM contact or account objects but this is not possible with CRM 1.x. The resulting UI would allow an end user to associate different contacts (or accounts) to an account. Example: Account: ABC - AccountPhysician: (existing account or con...

VCard issue #2
This is a weird problem, but when I send a vcard to someone, it shows up in my sent items as a vcf file, and has a vcard icon on it, but when the recipient gets the VCard, it shows up as msg file, with an envelope icon as the attachment. When I open it, nothing is there - it's empty. I can't find anything regarding this problem on google or MS's website. Anybody have any ideas? Is it a problem with Outlook? Do I need to do a detect and repair, a reinstallation? Thanks for your help! Does the same happen when you send a message to yourself? Is he/she able to see it w...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

2 Domains, 1 Exchange Server
Hi, We're trying to go with 2 seperate 2003 domains, but with only one Exchange 2003 Server. What would be needed for the domain that the Exchange server is not in to access e-mail? We've contemplated having those users use OWA, but would really like them to be able to use Outlook 2003. We're a school district and want to segregate the kids domain from the administration domain, but only have funding for one Exchnage server. Any ideas\help will be appreciated. TIA. Hi, This should explain what it requires: http://support.microsoft.com/?id=278888 Leif "tj woo...

Creating a Macro to Delete Commas #2
I have an excel file that the size will varry. I need a macro that will check all the fields for a comma. If there is one I would like to get rid of it. Does anyone have any idea how to do this? I have no idea and I have been assigned this task. Help --- Message posted from http://www.ExcelForum.com/ No macro required. ctrl-H for find/replace. find , replace nothing (leave the replace field blank). You can of course record that within a macro if you wish. Drabbacs >-----Original Message----- >I have an excel file that the size will varry. I need a macro that will >check ...

how do I import my contacts from IncrediMail 2.0 to MOutlook2007
I am new to using microsoft outlook 2007 and am searching for a way to upload my contact list, from Incredimail 2.0 to Outlook 2007. Any help would be definitely appreciated, thanks! How do I save my IncrediMail Address Book and move it to a different location? http://help.incredimail.com/incredimail/help_center/help_article.aspx?is=t&article_id=67&lang_id=9 In Outlook - File --> Import and Export ... import the CSV file created via process noted above Karl -- ____________________________________________________________ Karl Timmermans - The Claxton Group Co...

Money 2004 Debt Planner #2
When trying to add a loan to the debt planner, Money keeps telling me that I am 6 months past due on this particular loan. In reality, I have made consistent entries for each month's payment. This is making it really difficult to use the debt planner! What do I need to do? ...

Indirect Method for Name Box Variable? #2
DARN The reason I want to do this is that I have to collect data on a dail basis but I have to display it on a graph on a weekly basis. I select the entire week of cells and give it a name like week52. The following week I have to select the entire week and name i week53. Everything is set up that I can just copy and the numbers will progres for whatever length of time I need to graph (months, years, etc) excep this. Maybe I'll just go back to using the range of cell numbers. Thanks guys -- Chris Brenna ----------------------------------------------------------------------- Chris Bre...

80070005 error #2
I am getting this error when trying to view public folder property from system manager. My issue is same as what you can find out from http://forums.msexchange.org/ultimatebb.cgi? ubb=get_topic;f=19;t=000114 Anyone has a clue? ...

How do I insert space between 2 consecutive columns of an XL Shee.
I want to have space between two consecutive columns of a worksheet (of course, without having inserted another column between the two) in order to have separated the Border Lines of the adjacent cells/columns. Please guide me if it can be done in XL. Can you achieve the effect that you're looking for by using a double vertical border down the right side of the left column and having no border down the left side of the right column? Rgds, ScottO "Shamshad Butt" <Shamshad Butt@discussions.microsoft.com> wrote in message news:1222EE13-11A9-4354-9F12-D1F1155D3902@microsof...