invoke-sqlcmd Not Recognized

When attempting to run the invoke_sqlcmd from PowerShell you may receive the below exception:

The term ‘invoke-sqlcmd’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The Invoke-sqlcmd cmdlet is not included as part of PowerShell, but instead it is of sqlps (SQL Server 2008 PowerShell Host). Therefore, before using invoke_sqlcmd you should install SSMS  or the SQL Server 2008 Feature Pack . SQL Server 2008 Feature Pack allows you to install sqlps and its required assemblies (SMO and MSMXL 6.0) without any requirement for installing SSMS. When sqlps has been installed, you may then load invoke-sqlcmd into powershell.exe by using the below script:

http://blogs.msdn.com/b/mwories/archive/2008/06/14/sql2008_5f00_powershell.aspx



Related Articles :

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |