Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old March 27th, 2006, 04:17 AM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL DMO issue / Start - Stop SQL

Hi,

Looking for some help on a Stop / Restart of SQL Server via the DMO model. Problem :

. NT account does not have administrative rights.

So basically, I would need to Stop / Start SQL by means of the SA account. In additon, I would prefer to use the SQLServer.Shutdown method over the Stop method.

The fact that the sa account is hardcoded in the script does not harm.

The purpose of this undertaking is to reset the SQL server before running some maintenance scripts. Problem we have seen is that SQL sometimes seem to 'hang' on manual shutdown. Like if it just consumes too much RAM.

<<<

Set oSQLServer = CreateObject("SQLDMO.Sqlserver")

oSQLServer.Name = "."
oSQLServer.LoginSecure = False
'oSQLServer.Connect ".", "sa", "xxxxx"
oSQLServer.Stop

    Wscript.Sleep 5000

oSQLServer.Start FALSE

'True, ".", "sa", "xxxxx"

>>>

The code I'm struggling with ...

Thanks for your input on this,

Sebastiaan.
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL DMO issue / Start - Stop SQL Sebastiaan SQL Server 2000 0 March 20th, 2006 03:05 PM
How to know my COM+ stop start vanthq Visual C++ 1 January 17th, 2006 05:37 AM
How to know my COM+ stop start vanthq Pro VB Databases 0 January 6th, 2006 05:19 AM
Microsoft SQL-DMO (ODBC-SQLSTATE:HY000) fbalchu SQL Server 2000 0 February 4th, 2005 10:06 AM
Can we stop to fire trigger in SQL Server? vincentc SQL Server 2000 2 November 18th, 2003 12:52 AM





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