I nEED backup query to backup to disk but

  • no for all.

    only for speicifiec db .

    and remove old bak until 14 days

    thanks

  • Easiest is to use a maintenance plan for that, the cleanup task does the file removal, the backup task lets you select specific databases

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • no

    i have error in SQL AGENT .

    i need scripts .

  • liorvikel (7/27/2016)


    no

    i have error in SQL AGENT .

    i need scripts .

    Good luck. Perhaps if your post was a little more cordial and less demanding we could help. Maybe sharing the error messages would help us fix the problem. We like to help but we do not appreciate people who just demand stuff.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (7/27/2016)


    liorvikel (7/27/2016)


    no

    i have error in SQL AGENT .

    i need scripts .

    Good luck. Perhaps if your post was a little more cordial and less demanding we could help. Maybe sharing the error messages would help us fix the problem. We like to help but we do not appreciate people who just demand stuff.

    To add to what Sean said above, we are volunteers on this site and are not paid to just do your work for you. If you need help you really need to post more than a demand for service. We aren't mind readers, we don't have access to your system(s), so it is hard to help based solely on your posts.

  • liorvikel (7/27/2016)


    no for all.

    only for speicifiec db .

    and remove old bak until 14 days

    thanks

    Ola Hallengren has a fantastic script collection that does this and much more. And best of all, completely free. Take a look at https://ola.hallengren.com/[/url] and see if this helps you.

    (For completeness sake, I am also going to mention Minion backup[/url] - also free, and I hear a lot of good things about it, but I have no personal experience with this tool)


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • liorvikel (7/27/2016)


    no

    i have error in SQL AGENT .

    i need scripts .

    Can you copy and paste both the code and the error you're getting from SQL Agent, please?.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This is the error of agent in view history's

    ERROR: %1 is not a valid Win32 application.

  • liorvikel (7/27/2016)


    This is the error of agent in view history's

    ERROR: %1 is not a valid Win32 application.

    Now all we need is the code that caused that error and we might be able to help. The error is clearly saying that "%1" isn't a valid application and, since "%1" is typical of an operating system variable/parameter for a batch process, there's a piece of code somewhere that isn't being passed the correct parameter or the variable hasn't been defined correctly. Only you know or can find where this code is.

    As for backup scripts and *** previously mentioned on this thread, Ola Hallengren's code is good for those that prefer to use someone else's script. Google for it and download it and the instructions for installation and use.

    As a bit of a sidebar, if you don't already have it, download SQL Server "Books Online" and start reading about the different areas you want to know about, such a backups.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 9 posts - 1 through 8 (of 8 total)

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