Lost SQL Source Control Links using localdb
skuhn
Posts: 27 Bronze 3
Me and my team are using SSMS 17.7 along with SQL Source Control 6.0.2.6908 with git 2.17 on Windows. We have recently shifted from using a shared development database to using dedicated databases with localdb. We have observed that from time to time, the SQL Source Control links to our localdb databases are lost. We have 8 databases so it's time consuming to re-establish the links. This doesn't ever happen with our server databases. Any troubleshooting advice would be helpful for us to identify the cause of the issue.
Answers
Just happened to me.
I discovered my source control links had disappeared too - I think it must've happened when I installed 6.1.8.7584. Fortunately, I was able to restore a full version of LinkedDatabases.xml in the appdata folder (using previous versions) which saved a lot of pain relinking.
Any ideas?
Insert the resulting instance name in the LinkedDatabases.xml file.
I can't believe Redgate hasn't handled this issue after 2 years.
I started on a Python script to update the files automatically, but even after that, there's still something missing, as many of my tables appear to be unlinked after doing so.
I'll put my w.i.p. script here for some unfortunate future soul that tries to attempt the same, but I think it's pretty clear RedGate Source control does not support LocalDB! They should put that on the box…
Anyway, so here is the script: