From the course: PowerShell for SQL Server Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Running stored procedures in PowerShell

Running stored procedures in PowerShell - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Running stored procedures in PowerShell

- [Instructor] Often times, when you're dealing with databases in SQL Server, one of the things we're going to have to do is run stored procedures, because they're going to give us back a lot of information about our database. So, there might be things we need to iterate through that we'll get back from SQL. There might be business logic the we need to execute that's built into the stored procs, and maybe that business logic changes, or an app that our employees use needs to be able to execute that business logic as well, and so, the easiest place to put it is going to be a stored proc. So, when it comes to running stored procedures in PowerShell we can definitely do that, but it's going to be a very C# style environment to actually run that PowerShell code. So, there's no real easy SMO option or good SMO options for running stored procs, because there's a lot of variables that have to be passed in. So, we do do that through basically a very C# way of doing things. So, let's go ahead…

Contents