From the course: PowerShell for SQL Server Administration

Unlock the full course today

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

Creating procedures

Creating procedures - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Creating procedures

- [Instructor] Okay, so the next object that I want to look at is going to be creating stored procedures. So, you can create stored procedures in a couple of different ways. We can use SQLPS to go ahead and creating them, using the New-Object commandlet just like we did before. As we get into some more advanced objects in SQL Server, SMO is actually going to make less and less sense to use because things are going to get more and more complicated if we try to use SQLPS and SMO to actually create objects. This is going to be when we're going to go back to our Native T-SQL and things are going to make a lot more sense to just create stored procs into SQL. Writing stored procs, building applications in PowerShell with SMO, that can make a lot of sense. But sometimes it just doesn't. And once you start creating complicated objects that's going to be one of those times where it's not going to make a whole lot of sense.…

Contents