Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio schema compare can't find generated script

I am performing SQL Server schema comparison using Visual Studio 2017. I am pressing on "Generate script" button of Schema Compare utility and see the message

"Update scripts generated successfully"

However, I am unable to see the generated script. Any idea where this went or if it failed?

enter image description here

like image 369
Steve Coleman Avatar asked Jun 21 '18 23:06

Steve Coleman


People also ask

How do I compare two SQL scripts in Visual Studio?

On the Tools menu, select SQL Server, and then click New Schema Comparison. Alternatively, right-click the TradeDev project in Solution Explorer, and select Schema Compare. The Schema Compare window opens, and Visual Studio automatically assigns it a name such as SqlSchemaCompare1 .

How do I change the schema in Visual Studio?

To change the default schema for all future objects, right-click the Project and select "Properties". Under "Project Settings", change the Default Schema in the "General" section. That won't change existing objects, but new ones will be created in that schema.


2 Answers

According to this page "The generated script appears in a new Transact-SQL Editor window".

When this didn't work for me, i closed all open windows other than the schema compare window and re-checkmarked all differences in the list (i had un-checked some). After doing this and running "Generate Script" again, Visual Studio did actually open a new window with the script (The filename was "C:\Users\me\AppData\Local\Temp\MyDbName_Update1.publish.sql").

like image 181
Syntax Lowlights Avatar answered Nov 15 '22 11:11

Syntax Lowlights


I've noticed that if SSMS is running , SSDT won't generate Schema Compare script. As soon as I close SSMS and try to generate script again SSDT creates one successfully.

like image 23
user1508840 Avatar answered Nov 15 '22 11:11

user1508840