The ServerUserName property sets or returns the login user name for the instance of Microsoft® SQL Server™ containing the Data Transformation Services (DTS) package to be run by an ExecutePackageTask object.
object.ServerUserName [= username]
Part | Description |
---|---|
object | Expression that evaluates to an ExecutePackageTask object |
username | Login ID for the instance of SQL Server containing the DTS package to be run |
String
Read/write
HRESULT ServerUserName(BSTR* pRetVal);
HRESULT ServerUserName(BSTR pRetVal);
The ServerUserName and ServerPassword properties must be provided unless UseTrustedConnection is TRUE or the DTS package is contained in a storage file.
Note It is recommended that you connect to an instance of SQL Server using Windows Authentication instead of SQL Server Authentication. To use Windows Authentication, set UseTrustedConnection to TRUE.
This property also can be referenced through the Properties collection of the Task object with the following code:
Set taskprops = task.Properties
taskprops("ServerUserName") [= username]