Dropped/recreated SQL jobs and now SQL Agent can't run b/c old job_id is still being referenced by the Agent.

I've seen a common issue in several of our production environments where after we upgrade our software the SQL Agent can't run some jobs that were recreated as part of the process because they're referencing the old job_id (in msdb.dbo.sysjobs) that no longer
exists.  I can fix it easily enough by restarting the agent as this will flush whatever cache is being used by the Agent but I'd like a less invasive way to do this, if possible.
Is there any way to flush the cache used by the SQL Agent to store job_ids without having to restart it?  Thanks.

You may try this , and this solves this issue.. I hope if you do this then you no need to restart the agent...
DECLARE @jobId binary(16)
SELECT @jobId = job_id FROM msdb.dbo.sysjobs WHERE (name = N'Name of Your Job')
IF (@jobId IS NOT NULL)
BEGIN
EXEC msdb.dbo.sp_delete_job @jobId
END
DECLARE @ReturnCode int
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'Name of Your Job'
Raju Rasagounder Sr MSSQL DBA

Similar Messages

  • HT201250 I disconnected My Passport by mistake, and now Time Machine can not find it.  Although connected, it does not appear in the My Devices section of Finder.  What do I do?

    I disconnected My Passport by mistake, and now Time Machine can not recognise it.  It no longer appears in the My Devices section of Finder.  What do I do?

    Hello rjhc49,
    Thank you for the details of the issue you are experiencing with your external hard drive.  I found an article with steps you can take when an external device is not being recognized.
    I recommend following the steps in the section titled "Top troubleshooting tips" in the following article:
    USB and FireWire Quick Assist
    http://support.apple.com/kb/HT1151
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Running a SSIS package with SQL Job and Linked Server

    I have a SSIS 2008 package. In one of the Script task I am calling a stored procedure which is  using Openquery using linked server. I deployed this package with protection level as "EncryptWithPassword" and gave a password to the package.
    Created a SQL job and edited its command line to include the password. If I login to SQL Server Mgmt Studio with Windows Authentication and run the job manually it runs fine. But when I schedule it then I get an error that "The Communication link to Linked
    server failed".
    Please help 

    Hi Vivek.B,
    The issue should occur because the SQL Server Agent Service Account or SQL Agent Proxy account under which the job step runs doesn’t have sufficient permissions on the linked server.
    If the job owner is the sysadmin fixed server role, the job can be run under the SQL Server Agent Service Account or a proxy account, then please make sure the SQL Agent Service Account or the proxy account has corresponding login on the linked server. If
    the job owner is not a sysadmin fixed server role, the job must run under a proxy account. In this case, make sure the proxy account has a corresponding login on the linked server.
    Reference:
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2009/10/13/who-owns-my-job-and-who-runs-it.aspx
    Regards,
    Mike Yin
    TechNet Community Support

  • I dropped my Macbook Pro and now the battery is swollen, should I bring it to the genius bar?

    My Macbook Pro fell off my bed (approx. 3ft) and dented the left side of the front left corner on the battery meter. Besides the damage everything seemed okay for a little while until I kept getting a erratic curser track pad. I kept cleaning it thinking some dirty or oil may of got on it or in the edges, but long story short I found out my battery is swollen and thats the reason for the erratic curser. The drop and dent impacted the battery causing it to swell. I feel that I just need a new battery. I purchased my macbook from the apple store and still have applecare. However I've researched online a bit and saw some people posted that if you drop your macbook, Apple will void my coverage. I also read that when people have had a swollen battery and applecare, they just brought it into the Genius bar and they went to the back and brought them a new battery. I've been super nervous to go see them as I've spent the extra bucks on Applecare and did not get any use of it. If anyone has had this issue or knows about it, please let me know!!
    MacBook Pro 13" 2012, Mac OS X (10.9.3)

    I dropped my Macbook Pro and now the battery is swollen, should I bring it to the genius bar?
    Yes !
    I would take it in before it gets worse and breaks something.
    Genius reservation http://www.apple.com/retail/geniusbar/
    on-line https://getsupport.apple.com/GetproductgroupList.action
    check warranty https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • Hi I recently dropped my ipod touch and now it wont connect to itunes. Everytime i plug it in, i get an error message saying that the usb device is not recognized

    hi I recently dropped my ipod touch and now it wont connect to itunes. Everytime i plug it in, i get an error message saying that the usb device is not recognized

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • I inadvertantly dropped my iphone 3 and now have a white screen with green vertical lines to the right.  It won't sync with itunes due to an error. What can I do?

    I inadvertantly dropped my iphone 3 and now have a white screen with green vertical lines to the right of the screen.  It won't sync with itunes due to an error. What can I do?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    If it does not resolve the issue, the device is permanently damaged and will require replacement.

  • I dropped my ipod touch and now it wont charge

    I dropped my ipod touch and now it wont charge. When I plug it in to charge it just keeps going off and on.

    Not Charge
    - See:      
    iPod touch: Hardware troubleshooting
    - Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar      

  • I Drop My Ipod Alot And Now It Wont Charge It Wont Show My Notifications Even Doe They Are On My Home Button Wont Work Just A few Times But Thats It.and when on my vine i doesnt let me hear my vines idk why

    PLEASEE HELP I Drop My Ipod Alot And Now It Wont Charge It Wont Show My Notifications Even Doe They Are On My Home Button Wont Work Just A few Times But Thats It.and when on my vine i doesnt let me hear my vines idk why

    You broke it, you will need to get it serviced or replaced. The drop voided your warranty so you would have to do an out-of-warranty replacement with Apple.
    Please don't type in headline style, i.e. capitalizing every word.

  • Dropped my iPhone 4s and now there are lines across the screen?! Help!

    Hey everyone!
    So, I have recently dropped my iPhone 4S and now there are all these blue vertical lines across the screen, which occasionally change colour also.
    I am still able to receive messages and calls, and siri still works, it's simply that I can't see a single thing I am doing- which is very difficult!
    I was wondering if this is an issue that needs to be fixed at an Apple store- and if so, how much it would cost? Or if I would be able to fix it myself somehow.
    N.B: I've tried to reset it, it doesn't work. I have also tried to restore the iPhone, but iTunes won't let me do this as I have to have the 'find my iPhone' app turned off, which I cannot do because I can't see anything I'm doing!
    Thanks in advance for any help/suggestions,
    Kirstoodles.

    Kirstoodles wrote:
    I was wondering if this is an issue that needs to be fixed at an Apple store- and if so, how much it would cost?
    Yes. It's broken. A replacement will cost you $199.
    Or if I would be able to fix it myself somehow.
    The iPhone is not user servicable. Apple does not sell parts for the iPhone. any parts you could get are either stolen, counterfeit, or salvaged.  Atempting to fix it yourself will render it unsupportable and forfeit your right to service from Apple, including an out of warranty replacement.

  • I dropped my ipad 2 and now screen is green

    I dropped my ipad 2 and now screen is green.  ipad 2 Wi-Fi 16GB.

    I dropped my iPad today and immediately the screen was completely distorted.  Colors changed, images fuzzy, slow as can be, very hard to turn off or turn on.  I googled my problem and came to the https://discussions.apple.com site to read what I should do.  Not surprisingly, other people had this same problem.  What is INCREDIBLE is the way they suggested to resolve it.  I was hesitant at first but since SEVERAL people all said that it worked, I figured to give it a try.  A few people suggested SLAPPING THE BACK OF THE IPAD, NOT GENTLY, BUT FIRMLY.   A few good slaps and it looked a bit better.  Then my husband decided to DROP THE IPAD FROM ABOUT 2 FEET IN THE AIR ONTO THE CARPET, in a totally horizontal position.  THE SCREEN IS NOW PERFECT!! 
    For the last 2 or three weeks, the iPad has been very slow to load my apps, turning on and shutting down.  AS SOON AS I DROPPED THE IPAD, as described above, THE IPAD IS FAST, FAST, FAST. 
    I know, it sounds ridiculous that this should work, but it did.  I am certain that an Apple techie would never suggest this as a solution, but I swear to you, this has worked. 

  • SQL, PL/SQL Expression and PL/SQL function

    In a Post Calculation Computation field I wanted the following computation:
    if B is X
    then
    field = A
    else
    field = B
    end if;
    or as a decode
    Decode(B,X,A,B)
    I could not get this to work so I wrote a database function that simulates the decode. So when I put:
    My_decode(B,X,A,B)
    in the field it did work.
    Basically I am not sure what kind of code one is expected to put into SQL, PL/SQL Expression and PL/SQL function fields. Can someone give an example of each? Also the APEX help is sometimes incorrect.
    For example if you click the "Post Calculation Computation" label it says:
    The For example, if this item is named P1_X, you could use post calculation expressions such as UPPER(:P1_X), INITCAP(:P2_Y), MIN(:P1_X,:P2_Y-200), NVL(:P1_X,:P2_Y), or a function call such as return my_func(:P1_X); to set the final value of the item.
    But if you put return my_func(:P1_X); in the field you get an error. It should be just my_func(:P1_X);
    thanks Rene

    DECODE is only available in SQL, so would have to be used in a SQL Expression.Yes, that's what APEX keeps telling me when I use in in a field that has "SQL or PL/SQL expression" above it. So what do you put in the field?

  • Differ java.sql.* and javax.sql.*

    Dear Friends,
    What is differenece between java.sql.* and javax.sql.*?.
    Advance in thanks

    java.sql is the package you can use for all basic kinds of database access. If you are not developing a full scale enterprise application, java.sql package is all that you need.
    javax.sql is extension to the basic java.sql package. It includes classes that allow connection pooling and rowsets, among others.
    If you are just getting started with JDBC, you just need to get familiar with java.sql and leave the wonders of javax.sql until later.

  • I had to change my user ID because I used my email at my old job and now the old one keeps popping up and I can't sync mu phone or authorize my computer at work to sync my phone. to syn

    I had to change my user ID because I used my email at my old job and now the old one keeps popping up and I can't sync my phone or authorize my computer at work to sync my phone. I have a new user ID and PW that allows me into ITUNES but that old one won't go away. Any help? Thanks

    Hi, you can't change which ID was used to purchase any app. However, you can edit your Apple ID, which may be a better option than using a new id.

  • HT1937 I've set a factory job and now I can not remember my mail and I could not activate the phone ..alrjae help me re- activate the phone and this zip to communicate with me *****

    I've set a factory job and now I can not remember my mail and I could not activate the phone ..alrjae help me re- activate the phone and this zip to communicate with me ******
    <Email Edited by Host>

    Contact that someone else to have them delete their account.
    The previous owner needs to do this:
    Prepare your device to sell or give away
    There is no workaround for Activation Lock.
    iCloud: Find My iPhone Activation Lock in iOS 7 & later
    http://support.apple.com/kb/HT5818?viewlocale=en_US&locale=en_US
    http://support.apple.com/kb/TS4515

  • I dropped my iphone 5 and now there are bright lines on it. Help !

    I dropped my iphone 5 and now my screen has bright lines on it and the right side of the screen wont work. I took it into a iphone fix it place and they said the screen is damaged. Will apple or verizon give me a new iphone 5? The screen is not cracked at all. Just three bright lines on it. I got my iphone 5 in Decemeber!

    If you purchased AppleCare+ at the time you bought the phone Apple will replace the whole phone for $49. If you didn't they will replace it for $229.

Maybe you are looking for