Export (0) Print
Expand All

Application.FolderExistsOnSqlServer Method

Returns a Boolean that indicates whether the specified folder already exists on the instance of SQL Server.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public function FolderExistsOnSqlServer(
	strFolderName : String, 
	strServerName : String, 
	strServerUserName : String, 
	strServerPassword : String
) : boolean

Parameters

strFolderName
Type: System.String
The folder you are looking for.
strServerName
Type: System.String
The name of the instance of SQL Server to search for the package.
strServerUserName
Type: System.String
The SQL Server login name if you use SQL Server Authentication to log into the server; otherwise, a null reference (Nothing in Visual Basic) if you use Windows Authentication.
strServerPassword
Type: System.String
The SQL Server login password if you use SQL Server Authentication to log into the server; otherwise, a null reference (Nothing in Visual Basic) if you use Windows Authentication.

Return Value

Type: System.Boolean
true if the folder exists on the specified instance of SQL Server; false if the folder does not exist.

The following code example creates a folder on SQL Server, renames it, and then removes it. It also verifies the existence of the folder by using FolderExistsOnSqlServer.

No code example is currently available or this language may not be supported.

Sample Output:

myNewFolderExists? True

myNewFolderExists has been renamed but still exists? False

myRenamedFolder now exists? True

myRenamedFolder still exists? False

Community Additions

ADD
Show:
© 2015 Microsoft