July 17, 2008 at 7:29 am
In VS 2005 I created an Execute SQL Task with SQL code that moved a file from one location on my hard drive to another (using xp_cmdshell). The code looked as follows:
USE Master
DECLARE @CMD VARCHAR(1000)
SET @CMD='copy C:\FileName.csv C:\Archives\Filename.csv'
EXEC Master..xp_cmdshell @CMD
Now with SQL 2008 and VS 2008, there is Powershell. I have no idea how it works. I guess my question is:
Should I now use Powershell instead of xp_cmdshell to accomplish the same thing? If so, how does it work?
I know xp_cmdshell still works in VS 2008 - just wondering if they brought out a new feature to replace the xp_cmdshell?
thanks,
M
July 17, 2008 at 9:10 am
xp_cmdshell is part of SQL Server 2005 whereas PowerShell is an admin script more for servers.
In a nutshell it is to centralize more of repetative administration tasks. It is already part of Exchange 2007.
here is a link FAQs about Powershell.
http://www.microsoft.com/windowsserver2008/en/us/powershell-faq.aspx
My suggestion is to continue to use xp_cmdshell though I am curious if powershell will become the more secured preference to run batch within SQL server.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply