Re: xp_cmdshell at startup time

From: Anthony Thomas (ALThomas_at_kc.rr.com)
Date: 03/01/05


Date: Tue, 1 Mar 2005 00:41:22 -0600

I'm not positive but don't the startup procs run before or contemperaneously
with the xpstar startup proc that actually loads the binds to the extended
stored procedures, in which case they are not available at startup time.

Also, to be supported on Win2K3, you have to have SQL Server up to SP3a,
Build 760. And, I would recommend hot fixing at the very minimum to
MS03-031, Build(s) 818 and 819.

Sincerely,

Anthony Thomas

-- 
"David Gugick" <davidg-nospam@imceda.com> wrote in message
news:eQRYpQaHFHA.2936@TK2MSFTNGP15.phx.gbl...
Ramon Moliner wrote:
> Hi everybody,
>
>
> We have an stored procedure at master database that runs when SQL
> Server starts up (exec sp_procoption N'sp_ICarDMSStartup',
> N'startup', N'true').
> This stored procedure calls xp_cmdshell for retrieving hard disc
> information:
>
> INSERT #xpoutput EXEC master.dbo.xp_cmdshell "dir c:\dummy"
>
> When the procedure is executed at server's startup xp_cmdshell returns
> nothing.
> When we execute the procedure directly with the Query Analyzer (with
> SA login) the procedure returns the correct information and all works
> well.
> We know that xp_cmdshell must be executed with sysadmin permissions.
>
> Anybody knows wich permissions are in rule when a stored procedure is
> executed at server's startup time?
>
> Note:
> SQL Server engine is a SQL Server 2000 8.00.194 (Build 3790) running
> on Windows 2003
> The SQL Server service uses the "Local system account" at NT services
> param.
>
> Thanks in advance.
>
> Ramon Moliner
I'm guessing it's running under the priviledges of the SQL Server
Service Account. Log into QA using the service account and see if you
get the correct results. If not, add read access to the folder in
question to the service account.
-- 
David Gugick
Imceda Software
www.imceda.com


Relevant Pages

  • Re: sp_procoption and listing all stored procs config to run @ startup
    ... which sets stored procedure for autoexecution. ... Startup procedures must be owned by the database owner in the master ...
    (microsoft.public.sqlserver.security)
  • RE: xp_cmdshell at start-up time
    ... Have you tried changing the service account to a domain account? ... "Ramon Moliner" wrote: ... > We have an stored procedure at master database that runs when SQL Server ... > When we execute the procedure directly with the Query Analyzer (with SA ...
    (microsoft.public.sqlserver.programming)
  • Re: Startup SP
    ... SELECT name FROM sysobjects ... "San" wrote in message ... > How to find the stored procedure name which has been used as Startup ...
    (microsoft.public.sqlserver.server)
  • RE: SQL stored procedure executing twice
    ... I wasn't aware that DLookupwould execute the "domain" more than once. ... caused the stored procedure to execute twice. ... Dim stDocName As String ... My pass-thru query properties ...
    (microsoft.public.access.modulesdaovba)
  • Re: SQLserver and the WHERE x IN y
    ... to a stored procedure - that would only work if you introduced subtyping into ... the temp table from the calling procedure (the temp table is still in scope, ... INSERT INTO #MyTempTable EXECUTE YourPopulateProc 123 ... INSERT INTO @MyTableVar VALUES ...
    (microsoft.public.sqlserver.programming)