Showing posts with label regular. Show all posts
Showing posts with label regular. Show all posts

Monday, March 26, 2012

Scheduling a query at regular intervals in sql server 2005

Hi friend!

I want to schedule a query or procedure running at regular intervals eg.@. 12AM on everyday. Please help me to do this in SQL server 2005

Thanks/Regards

Antony S

There are 3 choices I can think of off the top of my head;

1/ Use SQL Agent (not available in express) and create a T-SQL job.

2/ Use the windows task scheduler to call SQLCMD and then have it call a .sql file with your code in it.

3/ Use a service broker timer.

|||Books online reference http://msdn2.microsoft.com/en-us/library/ms191439.aspx|||Create a SQL Job and a schedule inside of the job to run everyday at 12am. Make sure that SQLAgent is enabled.sql

Wednesday, March 21, 2012

Scheduled reboot of SQL Server on Windows 2000

I am descerning whether it is a good idea (or necessary) to reboot our SQL
Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
there any performance benefits in doing this? Does this help to defragment
memory?
There's no real benefit. However, you will likely incur a performance
penalty each time, since it will have to repopulate the data cache.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Cajun" <Cajun@.discussions.microsoft.com> wrote in message
news:FECF4E55-A44B-42CE-86E0-9D0915BD6490@.microsoft.com...
I am descerning whether it is a good idea (or necessary) to reboot our SQL
Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
there any performance benefits in doing this? Does this help to defragment
memory?
|||Hi -
Experts says :-
"This is a fairly common question, and the answer is fairly straight
forward, no. Assuming you are using Windows NT Server 4.0 SP6a, or Windows
2000 Server SP4, or Windows 2003 Server, and are running SQL Server 7.0 or
2000 (any service packs), there is no reason to automatically reboot your
server. Doing so will not offer you any performance benefits or enhance
reliability.
There is a common myth among many IS people that Windows Server software
needs to be rebooted regularly for it to work efficiently. There may have
been a grain of truth to this in previous versions of Windows NT Server
(before 4.0), but since 4.0, there has not been any need to reboot Windows
Server on a regular basis.
I have seen many, many Windows servers that are virtually never rebooted,
and they never have any problems due to the OS.
On the other hand, I have seen poorly written applications written for
Windows Server that have memory leaks that have force the need to reboot the
server on a regular basis. But this problem is the fault of the application,
not the OS. It is very possible that less knowledgeable IS staff in general
have improperly diagnosed the cause of a server's problem and blamed it on
the OS, and not the application as they should, which is perpetuating this
myth.
Since your SQL Server is not having any problems, leave it alone, and tell
the other people on your staff to stop listening to urban legends."
"Cajun" wrote:

> I am descerning whether it is a good idea (or necessary) to reboot our SQL
> Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
> there any performance benefits in doing this? Does this help to defragment
> memory?

Scheduled reboot of SQL Server on Windows 2000

I am descerning whether it is a good idea (or necessary) to reboot our SQL
Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
there any performance benefits in doing this? Does this help to defragment
memory?There's no real benefit. However, you will likely incur a performance
penalty each time, since it will have to repopulate the data cache.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Cajun" <Cajun@.discussions.microsoft.com> wrote in message
news:FECF4E55-A44B-42CE-86E0-9D0915BD6490@.microsoft.com...
I am descerning whether it is a good idea (or necessary) to reboot our SQL
Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
there any performance benefits in doing this? Does this help to defragment
memory?|||Hi -
Experts says :-
"This is a fairly common question, and the answer is fairly straight
forward, no. Assuming you are using Windows NT Server 4.0 SP6a, or Windows
2000 Server SP4, or Windows 2003 Server, and are running SQL Server 7.0 or
2000 (any service packs), there is no reason to automatically reboot your
server. Doing so will not offer you any performance benefits or enhance
reliability.
There is a common myth among many IS people that Windows Server software
needs to be rebooted regularly for it to work efficiently. There may have
been a grain of truth to this in previous versions of Windows NT Server
(before 4.0), but since 4.0, there has not been any need to reboot Windows
Server on a regular basis.
I have seen many, many Windows servers that are virtually never rebooted,
and they never have any problems due to the OS.
On the other hand, I have seen poorly written applications written for
Windows Server that have memory leaks that have force the need to reboot the
server on a regular basis. But this problem is the fault of the application,
not the OS. It is very possible that less knowledgeable IS staff in general
have improperly diagnosed the cause of a server's problem and blamed it on
the OS, and not the application as they should, which is perpetuating this
myth.
Since your SQL Server is not having any problems, leave it alone, and tell
the other people on your staff to stop listening to urban legends."
"Cajun" wrote:

> I am descerning whether it is a good idea (or necessary) to reboot our SQL
> Server 2000 servers on a regular basis (E.g., monthly or quarterly). Are
> there any performance benefits in doing this? Does this help to defragmen
t
> memory?sql

Monday, March 12, 2012

Scheduled events along with regular events

Hi!

Does it allowable to use scheduled events and regular events together in one subscription class? I get the error when I use then simultaneously. The description of error is
New request is not allowed to start because it should come with valid transaction descriptor.

It is being generated when the rule tries to run.

If I understand your question, you want to know if one subscription class can have event-driven subscriptions and scheduled-subscriptions. Is that right?

The answer is yes. When you define the Subscription class in the ADF, make sure you specify an EventRule and a ScheduledRule node, complete with the appropriate matching rules for each scenario.

HTH....

Friday, March 9, 2012

schedule stored procedure

How to schedule a stored procedure to run at a certain system time in a regular basis?Use SQL Server Agent. You could configure SQL Server Agent jobs in Enterprise Manager or SQL Server Management Studio. Or by sp: sp_add_job, sp_add_jobstep, sp_add_jobschedule|||If you do not have SQL Agent available (you're using SQL 2005 Express), you can combine the use of SQLCmd.exe, Windows Scheduler, and Stored Procedures.