Share via


ISqlSession.ExecuteScript method (String, Int32)

Executes a series of Transact-SQL queries from a text file based on the specified path and time allotted for each command to execute.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Sub ExecuteScript ( _
    path As String, _
    commandTimeout As Integer _
)
'Usage
Dim instance As ISqlSession
Dim path As String
Dim commandTimeout As Integer

instance.ExecuteScript(path, commandTimeout)
void ExecuteScript(
    string path,
    int commandTimeout
)

Parameters

  • path
    Type: System.String

    A string that contains the fully qualified path to the text file.

  • commandTimeout
    Type: System.Int32

    A 32-bit integer that specifies the time, in seconds, to wait for each command to execute.

Exceptions

Exception Condition
Exception

Failed to execute the command.

Remarks

Each query in the text file must be delimited by the word GO on a separate line.

See also

Reference

ISqlSession interface

ISqlSession members

ExecuteScript overload

Microsoft.SharePoint.Utilities namespace