Description: SQL Server client tools have very good functionality for creating database object scripts, but they don t always provide enough functionality to generate scripts the way programmers would like. These customized scripts could be used for database documentation. For that reason, database administrators and developers must code custom script generators. These generators usually generate scripts into text files that could be stored and versioned in a source control system. The custom generators could be created by using SMO objects. Scripting in SMO is controlled by the Scripter object and its child objects. A script is generated with the specified list and scripting options. The result is returned as a StringCollection system object.
To get started with SMO, first you must add a reference to Visual Studio. In the Add Reference window, select:
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoExtended
Microsoft.SqlServer.Management.Sdk.Sfc
Mircorost.SqlServer.ConnectionInfo
To Search:
File list (Check if you may need any files):
bin\Debug\SMOScriptingExample.exe
...\.....\SMOScriptingExample.pdb
...\.....\SMOScriptingExample.vshost.exe
...\.....\SMOScriptingExample.vshost.exe.manifest
...\Release\SMOScriptingExample.exe
...\.......\SMOScriptingExample.pdb
obj\Debug\ResolveAssemblyReference.cache
...\.....\SMOScriptingExample.csproj.FileListAbsolute.txt
...\.....\SMOScriptingExample.exe
...\.....\SMOScriptingExample.pdb
...\Release\ResolveAssemblyReference.cache
...\.......\SMOScriptingExample.csproj.FileListAbsolute.txt
...\.......\SMOScriptingExample.exe
...\.......\SMOScriptingExample.pdb
Properties\AssemblyInfo.cs
DBHelper.cs
Program.cs
SMOScriptingExample.csproj
SMOScriptingExample.csproj.user
obj\Debug\Refactor
...\.....\TempPE
...\Release\Refactor
...\.......\TempPE
bin\Debug
...\Release
obj\Debug
...\Release
bin
obj
Properties