Showing posts with label tocreate. Show all posts
Showing posts with label tocreate. Show all posts

Wednesday, March 21, 2012

question about launching an application at sqlserver startup

Hello,

What are the possible ways to make a GUI application start
automatically and run in a usual fashion (i.e. with a capability to
create windows) when mssqlserver starts?Hi

If you had a GUI where would you want it to display if there is noone logged
onto the server? Without a GUI you could write a service that is dependent
on the SQL Server service.

John

"Alexander Korovyev" <korovyev@.rambler.ru> wrote in message
news:26c82787.0407012306.fc5ace0@.posting.google.co m...
> Hello,
> What are the possible ways to make a GUI application start
> automatically and run in a usual fashion (i.e. with a capability to
> create windows) when mssqlserver starts?|||Alexander Korovyev (korovyev@.rambler.ru) writes:
> What are the possible ways to make a GUI application start
> automatically and run in a usual fashion (i.e. with a capability to
> create windows) when mssqlserver starts?

You can use a sp_procoption to mark a procedure as a startup procedure,
so that it is run each time SQL Server starts. From that procedure you
can call xp_cmdshell to run a command, but here is a catch: that must be
a command-line command, it cannot be a GUI, because SQL Server does not
have a desktop. However, you implement your application as another
service, but one that is permitted to interact with the desktop. (Exactly
how you would do this, I don't know, it's more of a Windows issue.)

Another alternative is to use the sp_OAxxx routines from your startup
procedure to interact with a COM object. A local COM object that uses
a GUI is not a good idea, but you could start a COM object on a remote
machine.

But I have question is: what is the real problem you are trying to solve?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp