This documentation is archived and is not being maintained.

TSqlObject.TryGetScript Method (String)

SQL Server 2014
 

Updated: April 20, 2017

Attempts to generate a CREATE script from the objects AST. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types. If it's unknown whether the object is capable of being scripted then the TryGetAst method should be used instead.

Namespace:   Microsoft.SqlServer.Dac.Model
Assembly:  Microsoft.SqlServer.Dac.Extensions (in Microsoft.SqlServer.Dac.Extensions.dll)

public bool TryGetScript(
	out string objectScript
)

Parameters

objectScript
Type: System.String

The DDL Creation script for the object.

Return Value

Type: System.Boolean

true if the DDL creation script was created; otherwise, false.

Return to top
Show: