A powerful, modern desktop application for generating SQL scripts and creating database backups with a professional UI/UX experience.
- Table Creation Scripts - Generate complete CREATE TABLE statements with proper data types, constraints, and identity columns
- Data Export - Export table data as INSERT statements (configurable row limits)
- Views & Procedures - Export views, stored procedures, and user-defined functions
- Indexes & Triggers - Generate index creation and trigger scripts
- Permissions - Export security and permission scripts
- Enhanced Backup Manager - Intelligent backup with automatic directory detection
- Multiple Backup Methods - Standard method and SQLCMD fallback for permission issues
- Compression Support - Automatic ZIP compression with progress tracking
- SQL Server Version Detection - Adapts features based on SQL Server version and edition
- INI-based Settings - Persistent configuration with auto-save functionality
- DROP Statement Generation - Optional IF EXISTS DROP statements before CREATE
- File Overwrite Control - Configurable file overwrite behavior
- Connection Profiles - Save and load database connection profiles
- Professional Interface - Clean, modern design with intuitive navigation
- Real-time Progress - Visual progress indicators for all operations
- Smart Status Updates - Color-coded button states and detailed status messages
- Table Search & Filter - Quick table search with pattern matching
- Bulk Selection Tools - Select all, select none, and invert selection
- Framework: .NET 8.0 Windows Forms
- Language: Visual Basic .NET
- Database: SQL Server 2012 and later
- Authentication: Windows Authentication & SQL Server Authentication
- IDE: Visual Studio 2022
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.5" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.5" />- Windows 10/11
- .NET 8.0 Runtime
- SQL Server 2012 or later
- Visual Studio 2022 (for development)
- Clone the repository:
git clone https://github.com/yourusername/RepoSQL.git
- Open
RepoSQL.slnin Visual Studio 2022 - Build the solution (F6)
- Run the application (F5)
-
Connect to Database
- Enter server name and database name
- Choose authentication method (Windows or SQL Server)
- Click "π Connect" to test connection
-
Load Tables
- Click "π Load Tables" to retrieve database objects
- Use search box to filter tables
- Select tables using checkboxes or bulk selection tools
-
Configure Options
- Choose script types (Tables, Views, Procedures, etc.)
- Enable "Include Table Data" for INSERT statements
- Access advanced settings via Tools β Settings
-
Generate Scripts
- Click "π Select Output" to choose destination folder
- Click "π Generate SQL" to create script files
- Use "πΎ Backup DB" for database backup with compression
The application creates organized SQL files with standardized naming:
Output_Directory/
βββ 01_TableCreate.sql # Table creation scripts
βββ 02_TableInsert.sql # Table data (if enabled)
βββ 03_Views.sql # View definitions
βββ 04_StoredProcedures.sql # Stored procedure scripts
βββ 05_Functions.sql # User-defined functions
βββ 06_Indexes.sql # Index creation scripts
βββ 07_Triggers.sql # Trigger scripts
βββ 08_Permissions.sql # Permission and security scripts
- Generate DROP Statements: Add IF EXISTS DROP statements before CREATE
- Overwrite Existing Files: Control file overwrite behavior without prompts
Settings are automatically saved to sconfig.ini in the application directory:
[ServerConfig]
Server=YourServer
Database=YourDatabase
IntegratedSecurity=True
[ScriptOptions]
Tables=True
Views=False
StoredProcedures=False
IncludeData=False
[GenerationSettings]
GenerateDropStatements=False
OverwriteExistingFiles=True- Smart Directory Detection: Automatically finds SQL Server accessible directories
- Permission Handling: Handles SQL Server permission issues gracefully
- Progress Tracking: Real-time backup progress with percentage completion
- Compression: Automatic ZIP compression with size optimization
- Fallback Methods: SQLCMD alternative for problematic environments
- SQL Error Translation: User-friendly error messages with solutions
- Connection Validation: Comprehensive connection testing
- File System Checks: Automatic directory creation and permission validation
- Database Migration: Export complete database structure and data
- Version Control: Generate scripts for source control integration
- Database Documentation: Create comprehensive database documentation
- Backup & Recovery: Regular database backups with compression
- Development: Quick script generation for development environments
- Schema Comparison: Export schemas for comparison tools
- Async Operations: Non-blocking UI during database operations
- Memory Efficient: Streaming data processing for large tables
- Timeout Management: Configurable timeouts for large operations
- Progress Feedback: Real-time progress updates for all operations
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Check the wiki for detailed documentation
- Feature Requests: Use GitHub Issues with enhancement label
- Built with love using Visual Basic .NET and Windows Forms
- Inspired by the need for a modern, user-friendly SQL script generator
- Thanks to the SQL Server development community for best practices
RepoSQL v2.0 - Professional SQL Script Generator for Modern Databases
