Server.Script Method ()


Generates a StringCollection of Transact-SQL statements that can be used to re-create the server.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Public Function Script As StringCollection

Return Value

Type: System.Collections.Specialized.StringCollection

A StringCollection object value that contains a list of Transact-SQL statements.

To generate a script that you can open and run in SQL Server Management Studio use the Server.Script Method (ScriptingOptions) and set the ScriptingOptions.FileName Property to create a new .sql script file.

Return to top