SQL Import - Database Integration & Query Tool
Data Import
SQL Import is a powerful Excel add-in feature that provides direct database connectivity and query execution capabilities, bringing your database data directly into Excel with full SQL query control. Whether you're connecting to SQL Server, MySQL, PostgreSQL, or other databases, this tool eliminates the complexity of database connectivity by providing direct SQL query execution with preview capabilities, connection testing, and flexible import options. Instead of exporting files or using complex database tools, you get instant access to your database data with professional Excel integration.
Key Benefits
How to Use
Basic SQL Import Process
- Go to UF Advanced tab → Data Import & Export group
- Click SQL Import to open the task pane
- Configure database connection:
- Choose database type (SQL Server, MySQL, etc.)
- Enter server details and credentials
- Test connection to verify access
- Write your SQL query in the query editor
- Click Preview to see query results
- Click Import to bring data into Excel
Advanced Query Operations
- Use complex SQL queries with JOINs, WHERE clauses, etc.
- Leverage database functions for data processing
- Apply filters and sorting at the database level
- Preview results to verify query accuracy
- Import optimized data directly to Excel
Examples
Example 1: Sales Data Analysis
Scenario: Analyzing sales data from your company's SQL Server database.
Implementation:
SELECT
p.ProductName,
c.CategoryName,
SUM(od.Quantity * od.UnitPrice) as TotalSales,
COUNT(od.OrderID) as OrderCount
FROM Products p
JOIN Categories c ON p.CategoryID = c.CategoryID
JOIN OrderDetails od ON p.ProductID = od.ProductID
WHERE od.OrderDate >= '2024-01-01'
GROUP BY p.ProductName, c.CategoryName
ORDER BY TotalSales DESC- Connect to SQL Server database
- Execute the sales analysis query
- Preview results to verify data accuracy
- Import to Excel for visualization and further analysis
Example 2: Customer Database Export
Scenario: Exporting customer information from MySQL database for marketing analysis.
Implementation:
SELECT
CustomerID,
CompanyName,
ContactName,
Country,
City,
Phone,
Email,
LastOrderDate
FROM Customers
WHERE Country IN ('USA', 'Canada', 'UK')
ORDER BY LastOrderDate DESC- Connect to MySQL database
- Execute customer export query
- Preview to check data quality
- Import to new Excel sheet named "Customer Analysis"
Example 3: Financial Reporting
Scenario: Creating a financial report from PostgreSQL accounting database.
Implementation:
SELECT
EXTRACT(YEAR FROM transaction_date) as Year,
EXTRACT(MONTH FROM transaction_date) as Month,
account_category,
SUM(CASE WHEN transaction_type = 'DEBIT' THEN amount ELSE 0 END) as Debits,
SUM(CASE WHEN transaction_type = 'CREDIT' THEN amount ELSE 0 END) as Credits
FROM transactions
WHERE transaction_date >= '2024-01-01'
GROUP BY Year, Month, account_category
ORDER BY Year, Month, account_category- Connect to PostgreSQL database
- Execute financial summary query
- Import for Excel-based financial analysis and reporting
Advanced Configuration
Database Connection Options
- SQL Server: Windows Authentication or SQL Server Authentication
- MySQL: Standard MySQL connection with user credentials
- PostgreSQL: PostgreSQL native connection with SSL support
- Oracle: Oracle database connectivity with TNS or direct connection
- SQLite: Local SQLite database file connections
Query Optimization Features
- Parameter Support: Use parameterized queries for dynamic data import
- Query Templates: Access helpful query templates and examples
- Syntax Highlighting: Enhanced query editor with syntax highlighting
- Query Validation: Basic SQL syntax validation before execution
- Result Limiting: Use LIMIT/TOP clauses for large datasets
Connection Management
- Connection Testing: Verify connectivity before executing queries
- Connection Reuse: Maintain connections for multiple queries
- Secure Credentials: Secure credential handling and encrypted connections
- Timeout Configuration: Configurable timeouts for long-running queries
Troubleshooting
Connection authentication failures
- Verify database credentials are correct
- Check authentication method (Windows vs SQL authentication)
- Ensure user has proper database access permissions
- Verify network connectivity to database server
Network and connectivity problems
- Check network connectivity to database server
- Verify firewall settings allow database connections
- Ensure database server is running and accessible
- Check if VPN connection is required
SQL query errors
- Validate SQL syntax for your specific database type
- Check table and column names for accuracy
- Verify user has SELECT permissions on required tables
- Test queries in database management tools first
Performance and timeout issues
- Optimize queries for better performance using indexes
- Increase timeout settings for long-running queries
- Use LIMIT/TOP clauses to reduce result set size
- Consider breaking large queries into smaller batches
- Always test database connections before executing queries to avoid errors
- Write optimized SQL queries for better performance and faster imports
- Use LIMIT or TOP clauses when working with large datasets
- Preview query results before full import to verify data accuracy
- Filter data at the database level rather than in Excel for better performance
- Leverage database indexes for faster query execution
- Save connection strings for repeated use with the same database
- Use parameterized queries for dynamic data import scenarios
- Consider pagination for very large result sets to manage memory usage
Common Use Cases
Business Intelligence
- Data Warehouse Queries: Extract data from enterprise data warehouses
- Cross-system Analysis: Combine data from multiple database systems
- Real-time Reporting: Import current data for up-to-date analysis
- Historical Analysis: Query historical data for trend analysis
Operational Reporting
- Performance Monitoring: Import system performance metrics
- Compliance Reporting: Extract data for regulatory compliance
- Audit Support: Import audit trail data for analysis
- Quality Control: Import data quality metrics and validation results
Data Integration
- ETL Processes: Extract data as part of larger ETL workflows
- Data Consolidation: Combine data from multiple database sources
- Migration Support: Export data for system migrations
- Backup Analysis: Analyze data from database backups
Frequently Asked Questions
SQL Import supports SQL Server, MySQL, PostgreSQL, Oracle, SQLite, and other databases with standard ADO.NET providers.
Currently, the tool focuses on SELECT queries. For stored procedures, consider calling them within SELECT statements if your database supports it.
The limit depends on Excel's capacity and your system memory. Use LIMIT/TOP clauses for very large datasets.
While connections aren't automatically saved, you can document connection strings for consistent reuse.
Yes, the tool supports SSL/TLS encrypted connections where supported by the database.
Related Documentation
Google Sheets Import - Public Sheet Data Integration
Import data from public Google Sheets directly into Excel with Google Sheets Imp...
Read DocumentationJSON Import - Advanced API Data Processing
Transform JSON data into Excel with JSON Import's powerful parsing, JSONPath que...
Read DocumentationXML Import - Advanced Structured Data Processing
Transform XML data into Excel with XML Import's powerful parsing, XPath queries,...
Read Documentation