SMO

The following table lists the SQL Server Management Objects (SMO) programming samples.

Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator.

Name Description

Readme_BackRest

Demonstrates how to back up and restore a database.

ReadMe_CheckIdentityValues

Performs identity checks on each table in the selected database.

Readme_CreateSPs

Demonstrates how to create a SELECT stored procedure for each table in the selected database.

ReadMe_DatabaseDefrag

Demonstrates techniques for implementing database defragmentation capabilities in database applications.

ReadMe_DatabaseSpace

Demonstrates techniques for implementing database space monitoring applications.

Readme_DependencyExplorer

Implements dependency tree and property display window.

ReadMe_IndexSizes

Demonstrates techniques for implementing database index space monitoring applications.

Readme_LoadRegAssembly

Demonstrates how to load and register a Microsoft .NET Assembly into Microsoft SQL Server. Uses the UtilityConversion assembly.

Readme_ManageDatabases

Demonstrates how to create, alter, and drop a database. Includes adding a new file group and log file.

Readme_ManageDatabaseUsers

Demonstrates how to add, modify, and remove users.

Readme_ManageTables

Demonstrates how to create, alter, and drop tables.

ReadMe_RebuildAllIndexes

Rebuilds all the indexes in the selected database.

Readme_ScriptTable

Demonstrates how to script the dropping or creating of a table.

Readme_ServiceBrokerConfiguration

Demonstrates how to create Service Broker objects by using SMO.

Readme_ServerConnect

Demonstrates how to connect to the SQL Server system.

Readme_ServerInfo

Displays a list of server and connection properties for the selected instance of SQL Server.

Readme_SmoBrowser

Browses the hierarchy of SMO objects using .NET reflection.

Readme_SmoCompare

Demonstrates techniques for implementing a comparison of two database objects.

ReadMe_SmoEvents

Demonstrates techniques for displaying SQL Server events in a console database application.

Readme_SmoPing

A console application that connects to the selected instance of SQL Server and dumps selected properties. Can be used to verify the SQL Server connection.

Readme_SmoScripter

Demonstrates scripting and retrieving database object dependencies.

Readme_SqlServerList

Enumerates a list of available instances of SQL Server.

Readme_SqlService

Displays the SQL Server services that are available to start, stop, pause, and resume.

Readme_Tracer

Reads and displays trace information from an instance of SQL Server.

Readme_UtilityConversion

Used with LoadRegAssembly. Contains demonstration common language runtime functions for use with SQL Server.

Readme_VerifyBackup

Verifies a backup on a backup device to ensure the data can be used to restore the database.

See Also

Other Resources

Preparing to Use SMO
Creating SMO Programs

Help and Information

Getting SQL Server 2005 Assistance