Activity overview
Latest activity by Louis_Gigantisch
So, updating the LinkedDatabases.xml file isn't enough. There are at least 3 other xml files that need to be updated. 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: import os, re
os.popen('sqllocaldb s MSSQLLocalDB')
stream = os.popen('sqllocaldb i MSSQLLocalDB')
output = stream.read()
match = re.search(r'pipe\\(.+?)\\', output)
instanceName = match[1]
for fn in (
r'C:\Users\[YOUR USERNAME HERE]\AppData\Local\Red Gate\SQL Source Control 7\LinkedDatabases.xml',
r'C:\Users\[YOUR USERNAME HERE]\AppData\Local\Red Gate\SQL Source Control 7\DifferenceFilters.xml',
r'C:\Users\[YOUR USERNAME HERE]\AppData\Local\Red Gate\SQL Source Control 7\OptionsStore.xml',
r'C:\Users\[YOUR USERNAME HERE]\AppData\Local\Red Gate\SQL Source Control 7\TableDataConfigs.xml'
):
with open(fn, encoding='utf16') as f:
a = f.read()
b = re.sub(r'(.+?\\).+?',
r'\1'+instanceName+'', a)
with open(fn, 'w', encoding='utf16') as f:
f.write(b)
#f.write(a) / comments
So, updating the LinkedDatabases.xml file isn't enough. There are at least 3 other xml files that need to be updated.I started on a Python script to update the files automatically, but even after t...
Yes, that issue was indeed relevant. LocalDB changes its server instance name every time it is restarted (e.g. when your machine reboots). You can get the new name by connecting to it in SQL Management Studio and executing this query: SELECT SERVERPROPERTY('InstanceName') Insert the resulting instance name in the LinkedDatabases.xml file. I can't believe Redgate hasn't handled this issue after 2 years. / comments
Yes, that issue was indeed relevant. LocalDB changes its server instance name every time it is restarted (e.g. when your machine reboots). You can get the new name by connecting to it in SQL Manage...
For future reference, this issue seems relevant: https://forum.red-gate.com/discussion/78940/localdb-db-linking-lost-when-management-studio-crashes / comments
For future reference, this issue seems relevant: https://forum.red-gate.com/discussion/78940/localdb-db-linking-lost-when-management-studio-crashes
I have the same problem, but there is no Version 6/7 change here. I've always been on 7, and Source Control forgets my links every time (or maybe just when there is a software update, which is almost every time I use the software). The LinkedDatabases.xml file is right were it's supposed to be, and contains the links I made. Any ideas? / comments
I have the same problem, but there is no Version 6/7 change here. I've always been on 7, and Source Control forgets my links every time (or maybe just when there is a software update, which is almo...
We have an ASP.NET project that generates code from the database using SQLMetal. Currently, we run SQLMetal on every project build, but ideally it only runs when the database has changed. Running it only after every "Get latest" would be preferable. / comments
We have an ASP.NET project that generates code from the database using SQLMetal. Currently, we run SQLMetal on every project build, but ideally it only runs when the database has changed. Running i...
Thanks for your response. The post script I'm hoping to execute is not for deployment, but solely for development, but I'll have to look into the options there; maybe that will be viable. / comments
Thanks for your response. The post script I'm hoping to execute is not for deployment, but solely for development, but I'll have to look into the options there; maybe that will be viable.
Is it possible to have a "post Get latest" script?
After doing a "Get latest" on my local database, I would like to run a tool that generates code from my updated database.Is there functionality for a post "Get latest" script? Or executing a batch ...