Thursday, July 2, 2009

MSSQL Programming and Query Writing Video Tutorial: Pt. 3 - A Sto red Procedure and Function to Return All Objects in a Given Schema

Pt. 3 - A Stored Procedure and Function to Return All Objects in a Given Schema - view details
Now that you have dbo.Split() created, you'll want to use it, right? This video shows you one of Scott Whigham's scripts for returning all objects in a schema. This uses dbo.Split(), the dbo.SequenceNumbers table from Part 1 of this section, and sys.objects to return all of the objects in specified schema.

So why is this stored proc/function here in our discussion of a table of numbers and how to work with arrays? The GetObejctsInSchema stored proc has a parameter, @ObjectTypesToExclude, that allows you to specify the object types you do not want to see. You then use dbo.Split() to return each as an ele ment and then pass your array to a NOT IN statement!


To download this video, Login then then visit the video's detail page and click "download".

Keywords for this video: arrays, sequence numbers, csv, comma separated values

This video comes from the SQL Server Programming and Queries online training course, SQL Server Programming (SQL Server 2005/2000): Transact SQL. And be sure to check out even more MSSQL Programming and Query Writing training videos.