Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)

abstract Script : unit -> StringCollection
override Script : unit -> 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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft