Questions tagged [sql-server-data-project]
24 questions
13
votes
4 answers
Comparing schema by schema name in Visual Studio and SQL Server
I have a SQL Server database with the default schema and a custom schema. So for example two tables might be database.dbo.table1 and database.customschema.table2.
I want to keep the "customschema" under source control, and I have loaded that into my…

Eric
- 191
- 1
- 10
7
votes
1 answer
SQL Server Data Tools - How do I preserve data along with schema?
I have been using a SQL Server project to manager the structure of a database.
First I created the project, then imported a database.
Then, when I need to make a schema change, say change a field name, I do it in the SQL Server Project, and then…

Greg Gum
- 33,478
- 39
- 162
- 233
6
votes
1 answer
Scaffold EF Core from Database Project
How can I scaffold EF Core directly from a Visual Studio SQL Server Database Project?
Solutions such as the following are preferred:
scaffold-dbcontext -connection "provider=ssdtproject, name=myprojectname.sqlproj"
scaffold-dbcontext -ddl…

shannon
- 8,664
- 5
- 44
- 74
6
votes
0 answers
DACPAC version number change causes drift but drift report is empty
I am working on source controlling a database using SQL Server Data-Tier Applications. I've created my SQL Server Database Project in Visual Studio and am now in the process of automating the deploy of the DACPAC via powershell. While testing out…

ryanulit
- 4,983
- 6
- 42
- 66
4
votes
2 answers
Create dacpac file programmatically from SSDT project
Is it possible to create a 'fresh' .dacpac file from an existing SSDT project? I would like to be able to recreate the database (teardown + setup) before each automatic end-to-end test:
const string dacPacFileName = @"D:\Bla.dacpac";
var…

cs0815
- 16,751
- 45
- 136
- 299
2
votes
1 answer
Missing toolbar in SSDT SQL Server Database Project sql file
In Visual Studio 2019, when i create a new sql query file, i can see a toolbar inside the tab like this:
With SQL Server Data Tools i have created a new SQL Server Database Project with .sql files of stored procedure and functions where this…

MERCCK
- 63
- 8
2
votes
0 answers
Suppression of reference errors in VS database project not working
I would like to suppress all SQL71561 errors in my database project. There are a lot of views that are built in this database that reference tables from another. However, it is not feasible for me to import that other database into a DB project, nor…

Tyler
- 103
- 1
- 9
2
votes
1 answer
How do you deploy different logins based on environment in SQL Server Database Project 2017?
I've read the following question: How to handle users and logins in Visual Studio Database Project?
Basically, I'm looking for a way to easily setup the logins based on the database server that's being deployed to. The additional catch is that this…

sr28
- 4,728
- 5
- 36
- 67
2
votes
0 answers
How to create a View in Sql Server Database Project without creating reffenrenced tables
I am trying to add a view to a Sql Server Database Project in VS 2015. The view references two tables, which are NOT defined in the project.
So, my view DDL looks like this:
CREATE VIEW [dbo].[My_View]
AS select a.Name, b.Name
from…

Volma
- 1,305
- 9
- 17
1
vote
1 answer
Can't update database project in .NET solution to .NET 6
I have an application, a solution with multiple projects, including one database project. The application was built in .NET 4.5 Core. All the C# code projects in it were later migrated to .NET 6. I've been able to build it and deploy it, and it runs…

Green Grasso Holm
- 468
- 1
- 4
- 18
1
vote
0 answers
Intellisense not working in Visual Studio for Sql Server Data Project
I am trying to switch from SSMS to Visual Studio using Sql Server Data Project, as I like the Project/Solution structure to organize related scripts.
However, I seem to be unable to get Intellisense to work as expected.
I am expecting to be able to…

Greg Gum
- 33,478
- 39
- 162
- 233
1
vote
0 answers
How to ignore build ERRORS (and not warnings) in VS2017 SQL Database projects
I work on VS 2017 with SQL Database projects. After to have generate all scripts, I have some errors (71501 or 71561 -> unresolved references). I want to use SQL Database projects only to compare a database with versioned scripts, only to have an…

Alexandre Blecich
- 65
- 1
- 9
1
vote
2 answers
Is there a way to use the actual database name as the Database Variable Name in a Referenced Database of a SQL Server Database Project?
It seems like when you add another database as a reference to a SQL Server Database Project, the way to reference that database in the query code is via the Database Variable Name which is the notation $(ReferencedDatabaseName):
So a query in the…

J.D.
- 954
- 6
- 22
1
vote
1 answer
How do you reference defined variables in a SQL Server Database Project?
I've read many questions on this such as:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/da4bdb11-fe42-49db-bb8d-288dd1bb72a2/sqlcmd-vars-in-create-table-script?forum=ssdt
and
How to run different pre and post SSDT pubish scripts depending…

sr28
- 4,728
- 5
- 36
- 67
1
vote
1 answer
How to generate the script of schema compare result in SQL Database Project
I am using SQL Server database project. Once I compare the schema I want to generate the updated changes script which I will run on Production Database to update the latest table schema and Stored procedure and function etc.
For example:
CASE 1:…

Prashant Pimpale
- 10,349
- 9
- 44
- 84