Automating script

  • I currently have a T-SQL statement that has been working on another server as a auto job.  Now I have a new SQL server so I moved the databases across and now this one job won't run automatically.  It runs fine if you paste it into Query Analyzer and run it, but as soon as you put it in an auto job it comes up with the following error.

    [Shared Memory]Invalid connection.  [Shared Memory]ConnectionOpen (Invalid Instance())

    Is there something else I need to do to this instance.  All the other auto jobs work fine.

    I had to add osql -E -Q "Exec storeProc to the query to get it to work on the other server, but it doesn't seem to help on the new one.


    Thanks,

    Kris

  • Where is the job run? What type of job is it? Is it a SQL Server Agent Job, or a .bat file ?

    SQL Server Agent Jobs have a Target Server list that the job is to be run against. If you've moved the job from one server to another, but not updated the Target Server list, it will still try to run the job on the other server.

    but you're mentioning osql here, which is a command line utility, so I'm confused on where this Job exists, and how it is called. If it is a SQL Agent Job, why use SQL Server to go to the command prompt only to call osql to get back into sql server? Maybe a T-SQL job step type would save you the heartache.


    Julian Kuiters
    juliankuiters.id.au

  • Target Server issues: http://www.sqlservercentral.com/columnists/sjones/killthattarget.asp

  • Thanks for the help, but I discovered the user error .  For some reason on one server the script required an osql statement but the new one doesn't.

    But it works now


    Thanks,

    Kris

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply