Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
0
votes
1
answers
448
views
SSDT db-project compare throws "source schema drift detected" for members of sysadmin
We are using SSDT database projects where changes will be done in the dev-DB, then a compare is done between the devDB and the VS-DBproject and selected changes is updated into the VS-project. Lately (maybe for about a month) the update of the VS-project has started to fail for me with the message "...
We are using SSDT database projects where changes will be done in the dev-DB, then a compare is done between the devDB and the VS-DBproject and selected changes is updated into the VS-project. Lately (maybe for about a month) the update of the VS-project has started to fail for me with the message "Source schema drift detected. Press Compare to refresh the comparison". There is no changes going on in the database at the time, of that I am sure (tried against several databases, also very small ones that no one else is using).
There are a couple of strange things that I cannot explain:
- We have three environments, dev, test and prod. The problem only happens when going against the dev or test-environments. Against prod it works. All three servers have the same version of SQL Server and Windows Server.
- We are several developers, but the problem only occur for some. After further investigation, it seems that those who get the problem are those that have sysadmin permissions on the SQL Server.
There is a workaround that is working for me: I can create a DacPac of the source DB and do the compare against that, and then the update will go fine. But this is more cumbersome to do. It is OK as long as it is only the sysadmins with the problem, but if all developers should get this problem...the workaround would be a problem.
Any one else have seen this problem? Any suggestions?
Our environment:
All developers use software installed on a Windows Server 2019:
Visual Studio Professional 2019 version 16.11.16
SSDT 16.0.62205.05200
SQL Server is running on a Windows Server 2016.
SQL SErver version is: 15.0.4312.2
GHauan
(615 rep)
Jul 14, 2023, 01:55 PM
• Last activity: Aug 2, 2025, 07:03 PM
1
votes
1
answers
797
views
Debugging T-Sql code using Visual Studio 2019. Error message: frame not in module
DBAs, Has anyone had success using **Visual Studio 2019** for debugging T-SQL code, the way **SSMS** allows **Step-into** & **Step-over**? When I hit debug (**Alt-F5**), gives me this error, after making some progress. Looks like once it hits the section of the code that calls another procedure, it...
DBAs,
Has anyone had success using **Visual Studio 2019** for debugging T-SQL code, the way **SSMS** allows **Step-into** & **Step-over**?
When I hit debug (**Alt-F5**), gives me this error, after making some progress. Looks like once it hits the section of the code that calls another procedure, it gives this error.
Frame not in module.
The current stack frame was not found in a loaded module. Source cannot be shown for this location.
**Example:**
1 ..
2 ..
3 SELECT 1 FROM sys.objects
4 SELECT dbo.SomeFunction(1)
5 UPDATE TABLE SET X = 1 ....
6
It runs well, until line 3, once it hits line 4, where it is calling a different function, it throws the aboe error. In SSMS, that line just opens a new window with code for the function and show debugging progress for each **F11** step-into -- but not in Visual Studio 2019 (Version 16.7.1)
Thanks
ToC
(727 rep)
Aug 19, 2020, 01:21 AM
• Last activity: Apr 28, 2025, 12:55 PM
0
votes
1
answers
858
views
How can I downgrade an SSIS project for use with VS 2017 standalone?
I inherited a project that was being built in VS 2019. After I finished building it and asked the requestor for clarification on how to handle a few scenarios I get a warning that the license for VS 2019 is about to expire. Turns out the project was running on the 30 trial license. The server is on...
I inherited a project that was being built in VS 2019. After I finished building it and asked the requestor for clarification on how to handle a few scenarios I get a warning that the license for VS 2019 is about to expire. Turns out the project was running on the 30 trial license. The server is on a network that is isolated in such a way I can't use an MSDN account to sign in. We were able to get VS 2017 Standalone shell installed with data tools using the off line method. Now the problem is I have a 2019 project and dts package with 2017 tools. Is there a way to downgrade the project to 2017?
RemonsterGrrr
(1 rep)
Mar 7, 2022, 08:24 PM
• Last activity: Apr 24, 2025, 11:12 AM
0
votes
0
answers
385
views
Visual Studio Data Tools (SSDT) schema comparison tool does not match database objects
I am using Visual Studio Pro 2019 (16.9.4) and SQL Server Data Tools (16.0.62103.10080) but this happens since the beginning of Visual Studio 2019. I use the Schema Comparison tool to compare databases/dacpac vs SQL projects. And everything goes fine until one day the comparison does not match the o...
I am using Visual Studio Pro 2019 (16.9.4) and SQL Server Data Tools (16.0.62103.10080) but this happens since the beginning of Visual Studio 2019.
I use the Schema Comparison tool to compare databases/dacpac vs SQL projects. And everything goes fine until one day the comparison does not match the objects from the source and target and suggests a creation and drop of ALL the object in the database as shown here:
I believe that something gets corrupted in the project, because from that moment on, the comparison tool is unable to match objects any more.
I've tried to erase *.dbmdl file, change the codification of the files (UTF-8 with/without BOM), erase the project and download it again, etc. but nothing works.
The same database/dacpac against other projects works fine... so it's something about the project!
Any suggestions?

Alex
(101 rep)
Oct 21, 2021, 08:07 PM
0
votes
0
answers
760
views
SSIS Dynamically Loop through SQL Tables
I have been fighting with an SSIS package for sometime now. I **did** successfully build a package that will extract data from a specific table by creating a date list from a script task, use a forEachLoop container to loop through the date list variable and create daily files. Package then uploads...
I have been fighting with an SSIS package for sometime now.
I **did** successfully build a package that will extract data from a specific table by creating a date list from a script task, use a forEachLoop container to loop through the date list variable and create daily files. Package then uploads them to S3 and deletes the data from the SQL table.
I am now trying to build this dynamically that will loop through a list of audit tables.
Tables will have different retention periods and different column structures.
So far I have created a SQL archive maintenance table that has a list of the tables and retention days, idea being we won't need to alter the SSIS package if we want to change the retention periods +/-
Script task that selects the list from the archive maint table and drops the output into a variable that is connected to a ForEachLooper container. I then planned to have another execute SQL task within the ForEachLooper container using the ? in my SQL statement to identify the user::tablename variable. After reading I understand I cannot just add the user::tablename variable as ? and I need to create it as an expression, or at least this was one suggestion.
I have tried the expression below, the variables are strings, I made he mistake originally where they were objects.
"SELECT DISTINCT CONVERT(VARCHAR, DateTimeModified, 23) AS ShortDate FROM " + @[User::ArchTableName] + " WHERE DateTimeModified <= DATEADD(MONTH, " + @[User::ArchTableRetentionDays] + ",GETDATE())
Trying to evaluate this I get an error
I am sure I have missed a step or have made a glaring error.
It may also be I am way off track with this as an idea, I also realise I need dynamically build the column lists of the tables as they are not the same structures but I am ignoring that until this is working.
If anyone has any advice or guidance I would appreciate it.
If there are ways to improve the question I am also open to suggestions.

Stockburn
(501 rep)
Sep 7, 2021, 06:15 AM
-2
votes
2
answers
1616
views
How to join two tables and rename the new table?
I want to join two tables in sql and want to connect it with my .net project where I used web forms. help is needed. thank you
I want to join two tables in sql and want to connect it with my .net project where I used web forms. help is needed. thank you
Deshani Amarasinghe
(1 rep)
May 19, 2021, 08:41 AM
• Last activity: May 19, 2021, 10:49 AM
0
votes
1
answers
81
views
What is causing BETWEEN to be replaced with <= and >=?
We have a Visual Studio solution for our SQL Server 2019 database, and it is stored in a git repo. One table has a couple of check constraints using the BETWEEN operator, like this. CONSTRAINT chk_FileTbl_MonthlyDate CHECK (MonthlyDate BETWEEN 1 AND 31) When I used Redgate SQL Compare 14 to compare...
We have a Visual Studio solution for our SQL Server 2019 database, and it is stored in a git repo. One table has a couple of check constraints using the BETWEEN operator, like this.
CONSTRAINT chk_FileTbl_MonthlyDate CHECK (MonthlyDate BETWEEN 1 AND 31)
When I used Redgate SQL Compare 14 to compare the repo to the database, it displayed the constraint reformatted with less than and greater than operators, like this.
CONSTRAINT chk_FileTbl_MonthlyDate CHECK (MonthlyDate >= 1 AND MonthlyDate <= 31)
I thought it was a bug/feature in Redgate's software and submitted a ticket for which I am awaiting a response. However, my colleague then used the comparison tool in Visual Studio 2019 and it did the same thing. If we look at the file defining the table, it uses BETWEEN, but both comparison tools show and deploy a change script with the less than/greater than format.
What is causing this behavior? We somewhat recently moved to SQL Server 2019, is it some kind of built-in optimization?
SQLDoug
(247 rep)
Jun 26, 2020, 02:16 PM
• Last activity: Jun 26, 2020, 02:43 PM
0
votes
0
answers
605
views
Where does master.dacpac come from in VS 2019?
We have some build tasks that run and for the life of me I can't figure out why the ms build tools isn't installing the master.dacpac file needed for the master and system dacpac files. Here's where it lives now: ```C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensi...
We have some build tasks that run and for the life of me I can't figure out why the ms build tools isn't installing the master.dacpac file needed for the master and system dacpac files.
Here's where it lives now:
:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\150\SQLSchemas
Currently, in VS2019 Professional it is added with the Data Storage and Processing Workload. SQL Server Data Tools is a dependency for several other workloads, such as:
- ASP.NET and web development
- ASP.NET and web development tools
- Azure Data Lake and Stream Analytics Tools
- Cloud tools for web development
In MS Build Tools, I noticed that the dacpac file isn't generated after installing the Data Tools workload.
Am I looking in the wrong place? What is generating the master.dacpac and the system.dacpac in C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\150\SQLSchemas
?
rdelgado-incinc
(1 rep)
Nov 22, 2019, 01:31 AM
• Last activity: Nov 22, 2019, 05:24 PM
0
votes
0
answers
578
views
SSIS not able to run package in SSMS
It's very simple package, running fine when executed via visual studio. From the report I get: [![enter image description here][1]][1] - Visual Studio 2019 Community - SQL2019CTP3.1 In the connection manager I am using windows authentication. The package has the following structure: - OLE DB source...
It's very simple package, running fine when executed via visual studio. From the report I get:
- Visual Studio 2019 Community
- SQL2019CTP3.1
In the connection manager I am using windows authentication. The package has the following structure:
- OLE DB source - simple T-SQL statement
- OLE DB destination - create table and insert the result of the statement
Can anyone tell what can cause this error? I find some topics telling this is a security issue, but not sure what kind of access I need to grant and to whom.
As I said, when I hit the

execute
button in the context of Visual studio the package and execute, a table is created in the destination database and records are inserted.


gotqn
(4348 rep)
Jul 27, 2019, 12:32 PM
• Last activity: Jul 28, 2019, 07:29 AM
Showing page 1 of 9 total questions