Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
how to sql server 2005 Execute a queryin the schedule of every day automatic ?

Jawab how to sql server 2005 Execute a queryin the schedule of every day automatic ?

  • 12 Mei 2012 12:56
     
     

    how to (sql server 2005) Execute a query in the schedule of every day \ time 12:00 Am automatic ?

    example : Execute a query (delete from [table1] where [name] like 'jone') automatic  every day \ time 12:00 Am

Semua Balasan

  • 12 Mei 2012 13:03
     
     Jawab

    Which edition of SQL Server?

    In any othre edition but Express, expand the node for SQL Server Ageent then work your way down until you have "New Job" on the context menu.

    On Express you don't have Agent, but you can use Windows Task Scheduler.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Disarankan sebagai Jawaban oleh Javier Villegas 13 Mei 2012 0:35
    • Ditandai sebagai Jawaban oleh srajmuneer 19 Mei 2012 19:22
    •  
  • 12 Mei 2012 20:53
     
     Jawab

    And in SQL EXPRESS you can use windows task manager to schedule a task that executes a SQL script by using the sql command line utility sqlcmd.exe:

    for example:

    C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -i"c:\your sql script with the delete table example.sql"

    if you need more info on how to use sqlcmd read this:

    http://msdn.microsoft.com/en-us/library/ms162773.aspx

    if you need any further help setting up the parameters of sqlcmd let us know. We can help you out.

    kind regards

    Edward


  • 14 Mei 2012 9:47
     
     Jawab

    hi,

    Create job in sql Server Agent with type as T-SQL and schedule it . Otherwise create a SSIS package and run either through SQL Server agent or as batch file.

    SKB.

    • Ditandai sebagai Jawaban oleh srajmuneer 19 Mei 2012 19:22
    •