Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2004, 08:31 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set query up to automatically run in SQL server

I met a problem. I don't know how I can set the query up to automatically run. Right now it must be run manually inside of the SQL query analyzer.

Here is the query:
BACKUP LOG VCCS_PRODUCTION WITH NO_LOG
GO
USE VCCS_PRODUCTION
GO
DBCC SHRINKFILE (VCCS_Production_Log, 2, TRUNCATEONLY)
GO

I will be apreciated for your answer!

 
Old October 21st, 2004, 09:44 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

You can create a job, create a step and insert your statement inside
then schedule it.

Jaime E. Maccou
Applications Analyst
 
Old October 21st, 2004, 11:17 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

As jemacc said but you will need SQLAgent running to do this.

Alternatively you can use osql in a batch file and schedule running of this file using Windows Task Scheduler.

--

Joe
 
Old October 21st, 2004, 04:24 PM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for your help, Jamacc and Joe : )
I will try soon






Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
Automatically run some codes in SQL server 2005 Andraw SQL Server DTS 1 June 4th, 2008 09:40 PM
how to run a set of SQL statments in AS400 sivuj18 ADO.NET 0 December 20th, 2007 11:39 PM
Query to be run against both SQL and Oracle NK Oracle 2 April 26th, 2004 05:28 PM
Run query automatically mateenmohd SQL Server 2000 9 March 28th, 2004 03:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.