9

I have created a SQL Server project (.sqlproj) in Visual Studio and have loaded it in VS Code, using the MS SQL extension. I can connect to my database and run SQL scripts, but that is not the point of a SQL Server project.

In Visual Studio a SQL Server project can be built, which creates a single SQL script out of the various scripts in the project, which you can use to create the full database on an empty database server. You can also run the build against an existing database, which will create an update script that will ALTER the existing database to the new version.

Can I build the .sqlproj in VS Code or is this option not supported? If this option is not supported, ist there another extension that can do a similar thing?

1
  • You mean there is no option like generating queries for creating table? Commented Jan 14, 2021 at 6:06

1 Answer 1

14
+25

The VS Code MSSQL extension provides additional features for SQL Server development but doesn't include additional capabilities like build, deploy, etc. like SSDT projects in Visual Studio.

You can, however, use Azure Data Studio with the SQL Database Projects extension (currently in preview). ADS is based on VS Code and provides a similar IDE experience. The ADS extension will allow you to generate schema upgrade scripts similarly to Visual Studio. ADS also includes many other features and extensions to facilitate database development and management.

Sign up to request clarification or add additional context in comments.

1 Comment

I had to add a nuget.config file ('dotnet new nugetconfig') in my solution's directory before the project would build. I was getting a NU1301 error beforehand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.