Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 How to run A SQL Job Of Restart Of Server, SQL Ser
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 12/20/2012 :  14:54:20  Show Profile  Reply with Quote
Basics: I'm running a SQL Server 2008 R2

I am trying to run a SQL job or maintenance plan on the startup (restart) of a SQL Server.
I’m trying to automate a Database Shrink job, which has to have exclusive access to the database to run. Realistically, the only time this happens is when the server is restarted, so I’m looking for a way to run a job on restart.

As always, any help is greatly appreciated
Thank you,


Flowing Fount of Yak Knowledge

7174 Posts

Posted - 12/20/2012 :  16:34:27  Show Profile  Reply with Quote
Cross posting
Go to Top of Page

Starting Member

35 Posts

Posted - 01/02/2013 :  17:07:12  Show Profile  Reply with Quote
why would you plan such a horrible job and not use an alternative?
Is the transaction log or the database files themselves to big?
If you want exclusive access to one database you can try to use
alter database set single_user (with rollback immediate)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000