SQL Database Project Power Tools is a Visual Studio extension that makes working with SQL database projects easier and more productive. This guide will help you get started with the key features.
SQL Database Project Power Tools enhances your Visual Studio experience when working with SQL Server database projects. It provides a collection of useful tools for importing databases, comparing schemas, analyzing code, creating diagrams, and more.
You can install the extension in multiple ways:
-
From Visual Studio: Open Visual Studio, go to Extensions > Manage Extensions, search for "SQL Database Project Power Tools", and click Install.
-
From the Visual Studio Marketplace: Download and install from the Visual Studio Marketplace.
-
From VSIX Gallery (SSMS) Download and install from Open VSIX Gallery
After installation, restart Visual Studio / SSMS to activate the extension.
SQL Database Project Power Tools adds project templates to make it easy to create new database projects. (Does not apply to SSMS)
- In Visual Studio, select File > New > Project
- Search for "SQL" in the project templates
- Choose the SQL Server Database Project template
- Name your project and choose a location
- Click Create
You can also add new items to your project using the enhanced item templates:
One of the most useful features is the ability to import an existing database schema into your project. This saves you time by automatically generating all the necessary SQL scripts.
To import a database:
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Import database
- Enter your database connection details
- Choose the file layout for the imported objects
- Click Import
The tool will create all the necessary files in your project, organized by object type.
The visual schema compare feature helps you keep your database project in sync with your live databases. You can compare in both directions:
- Compare your project with a database to see what needs to be deployed
- Compare a database with your project to update your project files
To use visual schema compare:
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Visual Schema Compare (preview)...
- Choose your comparison source database and target direction
- Review the differences in the visual schema compare tool window
- Apply the changes as needed
This is especially useful when working in teams or managing multiple environments.
Static code analysis helps you find potential issues in your database code before deployment. The analyze feature checks your SQL scripts against best practices and common pitfalls.
To analyze your project:
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Analyze
- Review the analysis report
- Address any issues found and improve your code quality
The analysis includes checks for design issues, naming conventions, performance concerns, and more. Consider adding this step to your regular development workflow.
The rule manager lets you visually control which static code analysis rules are active for your database project and how violations are reported. This is available for SDK-style SQL database projects.
Read more in the blog post.
To manage code analysis rules:
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Manage code analysis rules
- In the dialog, check or uncheck Enable Code Analysis on Build to turn code analysis on or off
- Browse or search for rules by ID, description, or category using the search box
- Use the ? link to open detailed rule documentation
- Use the severity filter drop-down to show only rules of a specific severity
- Enable or disable individual rules using the checkboxes
- For enabled rules, choose the severity (Warning or Error) using the drop-down
- Click OK to save your changes to the project file
You can also reset all rule settings to their default values with the Reset button
Rules are organized by category and can be enabled or disabled at the group level using the group checkbox. Your selections are saved to the RunSqlCodeAnalysis and SqlCodeAnalysisRules (or CodeAnalysisRules) properties in your project file.
Visualizing your database structure is easy with the E/R diagram feature. This creates a Mermaid diagram showing the relationships between your tables.
To create a diagram:
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Create Mermaid E/R diagram
- Choose which tables to include
- The tool generates a Mermaid markdown diagram
- View the diagram in Visual Studio or use it for documentation
These diagrams are perfect for documentation and help team members understand the database structure.
The extension adds a Solution Explorer node for the output of your project (a .dacpac file), making it easy to explore their contents.
To view a .dacpac file:
- Build your project
- Expand the project in Solution Explorer
- Browse through the xml files and postdeploy / predeploy scripts contained in the package
This is helpful when troubleshooting post and predeployment script issues.
When you need to include seed data in your database project, the Script Table Data feature generates INSERT statements for you.
To script table data:
- Select SQL Project Power Tools > Script Table Data
- Choose your data source and pick the table to script
- The tool generates INSERT statements for the table data
- The tool adds the generated script to your project in the
Post-Deploymentfolder
This is based on the popular generate-sql-merge script.
The Publish programmability objects on save feature automatically executes supported CREATE statements against a target database whenever you save a .sql file in your project. This gives you an inner-loop development experience where your stored procedures, views, functions, and triggers are kept in sync with your local database as you work.
Read more in the blog post.
Supported object types:
- Stored procedures (
CREATE PROCEDURE) - Views (
CREATE VIEW) - Functions (
CREATE FUNCTION) - Triggers (
CREATE TRIGGER)
When the feature runs, CREATE statements are automatically rewritten as CREATE OR ALTER before being sent to the database, so the object is created if it does not yet exist or updated if it does.
-
Right-click on your SQL database project in Solution Explorer
-
Select SQL Project Power Tools > Enable publish on save
-
If no
.envfile exists in the project directory, a sample file is created automatically:AutoPublish=Server=localhost;Database=YourDatabase;Integrated Security=true;TrustServerCertificate=true; -
Edit the
.envfile to point to your target database -
Save any supported
.sqlfile — the object is published immediately and a status message appears in the Visual Studio status bar
Note: Add
.envto your.gitignoreso that connection strings are not committed to source control.
You can enable or disable the feature at any time via Tools > Options > SQL Server Tools > SQL Project Power Tools and toggling the Publish programmability objects on save (preview) option.
The .env file must be located in the root directory of your SQL database project and must contain a key named AutoPublish with the connection string value, for example:
AutoPublish=Server=localhost;Database=MyDb;Integrated Security=true;TrustServerCertificate=true;
- When you save a
.sqlfile that belongs to a SQL database project, the extension reads the file and parses the T-SQL. - If the file contains only supported
CREATE(orCREATE OR ALTER) statements (plus optionalSET ... ON/OFFstatements likeSET ANSI_NULLS ON), the script is rewritten to useCREATE OR ALTERand executed against the database specified in the.envfile. - The status bar shows
Publish completed: <filename>on success orPublish failed: <filename>if an error occurs. - Files that contain unsupported statements (for example
CREATE TABLE) are silently skipped.
The Add Azure DevOps Pipeline... command creates a commented starter pipeline that builds your project and deploys it to one or more environments.
- Right-click on your SQL database project in Solution Explorer
- Select SQL Project Power Tools > Add Azure DevOps Pipeline...
- Choose the target, agent pool, authentication, firewall strategy and environments
- Follow the checklist in the generated
pipelines/PIPELINE-SETUP.md
The pipeline uses passwordless access with workload identity federation, temporary firewall rules for Microsoft-hosted agents, the latest SqlPackage, and a plan stage with approval for staging and production environments.
Read the Azure DevOps deployment guide for the details behind each choice.
All SQL Database Project Power Tools features are accessible from the context menu in Solution Explorer:
Simply right-click on your SQL database project and look for the SQL Project Power Tools menu option.
For even more features, consider installing the SQL Project Power Pack, which includes:
- T-SQL Analyzer: Real-time code analysis with over 140 rules
- SQL Formatter: Automatic code formatting with .editorconfig support
- Start with Import: If you have an existing database, use the import feature to get started quickly
- Regular Schema Compares: Keep your project and database in sync by comparing regularly
- Use Analysis: Run the analyzer before deploying to catch issues early, or integrate static code analysis into your CI/CD pipeline
- Document with Diagrams: Create E/R diagrams to help your team understand the database structure
- Version Control: Keep your database project in source control to track changes over time
If you need help or want to learn more:
- Review the SDK user guide for advanced topics
- Report issues or request features on GitHub
- Rate the extension on the Visual Studio Marketplace
Now that you're familiar with the basics:
- Create or import a database project
- Explore the various features
- Set up your development workflow
- Share your feedback to help improve the tool
Happy database development!







