DECLARE @statement NVARCHAR(128) SET @statement = 'EXEC xp_cmdshell ''copy C:\Temp\SQLTesting\Cycles.xls ' + 'C:\Temp\ ' + '''' EXEC sp_executesql @statement Why this scripts don't work on SQLExpress 2005,on result i have ACCESS DENIED,why??? Thanks advance.
Are you connecting with a Login which is a member of sysadmin server fixed role? Is you SQL Server service account has enough rights to access to that path? What is your OS, Vista? If so, is UAC enabled? -- Ekrem Önsoy "Dr.Acrobat" wrote in message news:ehO9$Sr3IHA.1436@TK2MSFTNGP05.phx.gbl... > DECLARE @statement NVARCHAR(128) > SET @statement = 'EXEC xp_cmdshell ''copy C:\Temp\SQLTesting\Cycles.xls ' > + > 'C:\Temp\ ' + '''' > EXEC sp_executesql @statement > > Why this scripts don't work on SQLExpress 2005,on result i have ACCESS > DENIED,why??? > Thanks advance.
I solve that problem i create excel file without EVERYONE permission. Thanks. "Ekrem Önsoy" wrote in message news:7EA74F4F-54FE-4959-9033-305BA392DE15@microsoft.com... > Are you connecting with a Login which is a member of sysadmin server fixed > role? > > Is you SQL Server service account has enough rights to access to that > path? > > What is your OS, Vista? If so, is UAC enabled? > > -- > Ekrem Önsoy > > > > "Dr.Acrobat" wrote in message > news:ehO9$Sr3IHA.1436@TK2MSFTNGP05.phx.gbl... >> DECLARE @statement NVARCHAR(128) >> SET @statement = 'EXEC xp_cmdshell ''copy C:\Temp\SQLTesting\Cycles.xls ' >> + >> 'C:\Temp\ ' + '''' >> EXEC sp_executesql @statement >> >> Why this scripts don't work on SQLExpress 2005,on result i have ACCESS >> DENIED,why??? >> Thanks advance. >