Import-BcpDatabase
Creates a new powerLoad Database and loads it with metadata from the specified Vault BCP package.
Syntax
Import from a Vault BCP package:
Import-BcpDatabase -Package <DirectoryInfo> [-ConnectionString <string>] [-Force] [<CommonParameters>]
<#
PARAMETER
-Package
Required true
-ConnectionString
Required false
-Force
Required false
<CommonParameters>
This cmdlet supports the common parameters: ErrorAction, ErrorVariable
#>
Parameters
Type |
Name |
Description |
Default value |
|---|---|---|---|
Package |
Absolute or relative path to the Vault BCP package directory that contains the XML files |
||
string |
ConnectionString |
Connection details for the SQL Server instance, usually the one running on the ADMS server. |
Data Source=(local)\AUTODESKVAULT;User ID=sa;Password=AutodeskVault@26200;Encrypt=false |
SwitchParameter |
Force |
Drops and recreates the powerLoad DB, e.g. if the same Vault BCP package was already imported previously. |
False |
Return type
powerLoad DB ← On success, the cmdlet returns connection details for the created powerLoad Database, including the database name and a usable connection string.
empty ← On failure the Exception/ErrorMessage can be accessed using $Error.
Remarks
The cmdlet connects to the SQL Server instance that typically runs directly on the current ADMS environment (for best performance via shared memory).
It makes use of the Connect-BcpDatabase cmdlet for this purpose.
It then creates a new powerLoad Database with performance-optimized settings (such as single-user mode) to allow fast bulk loading.
With the -Package, it fills all tables using the XML files in the specified Vault BCP packge directory (Vault.xml, ItemsWrapper.xml, BOMWrapper.xml, and CustomObjectWrapper.xml).
The generated SQL database name always starts with the prefix powerLoad_. For imports from the file system or other SQL databases, the database name also includes a timestamp.
When importing a Vault BCP package, the package name is added instead. Especially for delta runs, it’s good practice to include a timestamp directly in the name of the exported BCP package.
Therefore, if you want to run the cmdlet again for the same BCP package, use -Force to recreate the powerLoad DB.
After the import, the cmdlet provides the name of the created database and a connection string ready for use with Microsoft’s Invoke-Sqlcmd cmdlet.
By this point, all required columns are filled, and all primary keys and foreign keys between the tables are created.
Examples
Import a Vault BCP package into a new powerLoad DB
In the following example we are using our VaultBcp 2024 sample package for demonstration purposes:
$db = Import-BcpDatabase -Package '.\BCP_SamplePackage'
$db
<#
Database ConnectionString
--------------------------- ----------------
powerLoad_BCP_SamplePackage Data Source=(local)\AUTODESKVAULT;User ID=sa;Password=AutodeskVault@26200;Encrypt=false
#>