Share via


Where does SSDT Schema Compare Generate the script????????

Question

Wednesday, November 8, 2017 6:06 PM | 1 vote

Very nice SSDT tool...  so I compare a couple databases, hit the "Generate Script" button... it says it completes.. and ???? where the heck is it???

When I use the "Generate Script" for a Data compare, it very nicely opens a new editor window with the script. This is not happening for Schema compare.

Using SSDT 15..4.0 Preview for VS 2017.

All replies (4)

Tuesday, November 14, 2017 3:36 PM

Hi c b,

Don't know whether or not you already figured this out, but I just generated a script from a schema compare, and on my environment (SSDT 15.4.2) it saved it in my user directory:

hth,

Cees

Please remember to mark replies as answers or at least vote helpfull if they help and unmark them if they provide no help.


Friday, January 12, 2018 5:52 PM

I just had this happen to me as well. The tool was unsuccessful but didn't generate any errors. After a reboot I tries again and got further and there were more success messages.

So, classic Microsoft fix: Reboot, Try again... Repeat as needed.


Monday, September 23, 2019 2:16 PM

Sometimes I just really hate Microsoft.

FROM ANOTHER SITE, and as I have now discovered,

1)  It will open a new page when successful,

2) and save the script to:  C:\Users\your user id>\AppData\Local\Temp

Depending on the number of changes, you may have to wait a bit.  If a new tab does not appear with the script, then it failed to run and failed to generate a script.

Mine ran about 54 seconds and generated a 20,000 line script.  (yeah, lots of changes.)

It appears closing the SQL Server Management Studio is required for this to work, because, <sarcasm>like who would ever have both open at once?!</sarcasm>

Looking through options, I saw nowhere a field to specify where MSVS drops your result query.

IF YOU USE THE PUBLISH FUNCTION, it gives the option to generate a script as well, which seems to work better than the scriptiong button on the tab, though I have no idea why.  I'm sure the script is created with the same code.


Tuesday, December 3, 2019 10:56 PM

A little late but I was trying to generate a SQL change script from SSDT and running into the same issue. It turns out that if a login is made OR attempted on the 'sa' account between the time you click "Compare" and "Generate Script", a drift issue is detected and the process is halted. This is because even an attempt to the 'sa' account alters the datestamp of last attempted login and this causes SSDT to flag a change and complain of the source being "stale".

If you happen to have SQL Server on the DMZ, you probably have constant brute force attempt bots hitting your server. This causes you from being able to generate the change script from SSDT. Disable the 'sa' account temporarily or disable TCP until you have generated the script then enable it back.

Hope this helps someone out. I was pulling my hair for hours trying to figure it out. It turns out I had brute force attempts going against my DB during the time I was trying to generate the script.