SqlShare.com Logo
 
Skip Navigation Links
Home
Channels
Classes
About Us
Login / Register
Subscribe to the All channels feed  Goto the SqlShare.com blog
Image of Tim Mitchell
Author:

Author Bio:
Tim Mitchell is a Microsoft SQL Server database developer, business intelligence consultant, writer, and speaker. He has been working professionally with SQL Server for over six years, and holds the MCTS and MCDBA certifications from Microsoft as well as a Bachelor's degree in computer science from Texas A&M University - Commerce.
Enumerate SQL Server Databases using SMO

Enumerate SQL Server Databases using SMO

As a DBA it's common to need to loop through all databases on a server to apply a change or check a setting - perhaps making sure that auto shrink is not on. Lots of ways to do the loop, but one way is to use SQL Management Objects (SMO) and you may find it to be a surprisingly elegant approach. Watch this short video to learn the basics of the loop, see Tim's profile for a ton of other content on SMO.

Video Information
Publish Date:
September 09, 2008
Length:
3:24
Skill Level:
200
Rating:
4.27 out of 5

After watching you should be able to answer these questions:
  1. Which method is used to return the list of SQL Servers?

  2. Using SMO, what is the easiest way to retrieve the list of databases for a given server?
You must be logged in to view this video.    

Bookmark and Share

  Rate This Video:  
 
1=Poor, 3=Good, 5=Excellent
Comments:
Jay on 6/30/2009
Broken link to code http://www.jumpstarttv.com/references/smo/Enumerate_SQL_Server_Databases_using_SMO.zip

dun on 6/30/2009
Did you need to use a foreach for databases? Why not use the same databinding method for databases as you did with the servers?

Gerry Doan on 6/30/2009
nice - succinct and useful exposition.

A482609282 on 7/1/2009
very good

Dan on 7/1/2009
Very Cool!

Jamshid Nouri on 7/1/2009
great video

Chris Rock on 7/1/2009
The link to the code is fixed.

Dipak Saha on 7/2/2009
Great topic.



Must Be Logged In

References
Download the code from this video

Sponsored Ads
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions