You are here: Re: Using sql to execute a batch file, xp_cmdshell « MsSQL Server « IT news, forums, messages
Re: Using sql to execute a batch file, xp_cmdshell

Posted by mcolson on 08/15/07 17:28

On Aug 10, 3:23 pm, Roy Harvey <roy_har...@snet.net> wrote:
> On Thu, 09 Aug 2007 21:23:07 -0000, mcolson <mcolson1...@gmail.com>
> wrote:
>
> >When I use the xp_cmdshell to try and run the bat file, i get an
> >output saying access denied. It should be noted that I am using sql
> >server 2005 express. Is this why. When I try to copy the file to
> >another location, i get 0 copied. I am able to dir the directory just
> >fine.
>
> I am not familiar with Express, but I don't think it is any different
> in this area. What is important to remember is that any command run
> through xp_cmdshell is running under the account designated for that,
> and that is the account that needs the permissions. Running
> xp_cmdshell 'set' and inspecting the results should tell you the
> account being used.
>
> While it does not appear to be your problem it is worth noting also
> that xp_cmdshell runs in a context without any mapped drives, so any
> files on a network drive must be referenced using a UNC path of the
> form \\servername\sharename\folder...
>
> Roy Harvey
> Beacon Falls, CT

Sql is setup as a Network Service. I could change it to a local user,
but would prefer not to. I'm trying to setup a credentials named
"Matt". In here I have entered the login and password for an accepted
user of the file. How do I tell the stored procedure to use this
credential when I am running the bath file?

Thanks,

Matt

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация