Import
DBCode’s Import feature allows you to easily transfer data from various sources into your database tables, streamlining the process of populating tables with data from files or other database objects.
Overview
The Import feature supports importing data from:
-
Files:
- CSV (Comma Separated Values)
- JSON (JavaScript Object Notation)
-
Database Objects:
- Tables from the same or different database
- Views from the same or different database
Starting the Import Process
There are two ways to initiate an import operation:
Method 1: Table-Specific Import
- In the Database Explorer, locate the target table
- Right-click on the table
- Select Import Data
- The Import dialog opens with your selected table pre-configured as the destination
Method 2: General Import
- In the Database Explorer, right-click on the Tables group
- Select Import Data
- The Import dialog opens, requiring you to select a destination table
Import Workflow
Step 1: Select Source
-
Choose the source type:
- File: Import from a CSV or JSON file
- Table/View: Import from another database object
-
If selecting File:
- Click Browse to locate and select your file
- Select the file format (CSV or JSON)
- Configure any format-specific options:
- For CSV: delimiter, quote character, header row settings
-
If selecting Table/View:
- Choose the source connection (can be the same or different from destination)
- Select the database containing the source
- Choose the specific table or view to import from
Step 2: Map Columns
The Import interface displays:
- Source columns on the left
- Destination columns on the right

Each column mapping shows:
- Source column name and data type
- Destination column name and data type
By default, DBCode attempts to match columns by name and compatible data types.
Step 3: Preview Data
- Click the Preview button to examine sample data from the source
- Preview rows appear transposed (horizontally) between the source and destination columns
- This preview helps confirm:
- Data values look correct
- Column mappings are appropriate
- Data types are compatible
Step 4: Execute Import
- Review your mappings
- Click the Import button to begin the process
- A progress indicator displays the import status
Column Mapping Features
Automatic Matching
DBCode automatically maps columns based on:
- Identical column names (case-insensitive)
Manual Adjustments
You can manually adjust mappings by:
- Using the dropdown selector to change mappings
Best Practices
Preparation
- Ensure your destination table exists with appropriate columns
- Check that source data types are compatible with destination columns
- Consider creating a backup before importing to production tables
Troubleshooting
Common Issues
Issue | Possible Solution |
---|---|
Data type mismatch | Apply appropriate transformations or adjust target column types |
Character encoding problems | Ensure CSV files are properly encoded (UTF-8 recommended) |
Error Messages
- “Cannot convert value X to type Y”: Data type incompatibility between source and destination
- “Constraint violation”: Source data violates a constraint in the destination table
- “File format error”: Source file doesn’t match expected format (CSV delimiters, JSON structure)
Limitations
- Maximum file size for imports is determined by available memory
- Complex JSON structures may require flattening before import
- Some database-specific data types may have limited support
The Import feature provides a flexible way to populate your database tables from various sources, streamlining data migration and entry processes directly within VS Code.