1

I want to do something similar to a Linked Server but i want to see SVN logs using SQL Server,

Currently I have 2 different databases, the first one running on SQL Server 2012, the second on MySQL 5.5 (an old one), both of them have on their main tables a field called "BugID", and i was able to create a report similar to this:

SELECT *
FROM OPENQUERY(
    DB1_MYSQL_LINKEDSERVER, 'SELECT field1, field2, bugId  FROM some_mysql_table'
) AS mysql_data
JOIN OPENQUERY(
    DB2_SQLSV_LINKEDSERVER, 'SELECT field3, field4, bugId FROM some_sqlsv_table'
) AS sqlsv_data ON mysql_data.bugId = sqlsv_data.bugId 

However, now i want to cross that information with SVN LOGS, something like this:

JOIN OPENQUERY(
    DB3_SVNLG_LINKEDSERVER, 'SELECT log_message, bugId FROM svn_logs'
) AS svnlg_data ON svnlg_data.bugId = sqlsv_data.bugId 

As a workaround I think I can execute svn log --xml using cmd and populate some table from the XML file, however that seems to be a lot of work, so I'am wondering if there's a way to do this transparently.

luiscla27
  • 4,956
  • 37
  • 49
  • Why copy data that's already in one DB (SVN repository) to another DB (SQL)? What's the use case? – bahrep May 12 '20 at 16:27
  • Coping data is the workaround, i don't want to copy data, my use case is to JOIN the SVN log data with another databases, there´s some data that it doesn't exist in SVN Repository, I'm building a report – luiscla27 May 12 '20 at 16:33
  • I think that you could use links to a changeset view of a revision, see the second paragraph of my answer. – bahrep May 12 '20 at 16:34

1 Answers1

1

You can call svn log with the --xml option. Parse the XML-ed output and store the information you need in your database

However, instead of copying data from the SVN repository to the SQL database you could simply specify a link to a revision in the server's web UI. The link looks as follows https://demo-server.visualsvn.com/!/#asf/commit/r1877259/head/subversion/trunk and leads to a web page with a log message, diff all other information.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • Both approaches are incomplete for my requirement, the `svn log --xml` command would be great if the output could be directly seen from SSMS (which is not)... The VisualSVN link approach is not better because that link points to a single revision and i need to query all of them, by now I'm trying the `svn log` way, but still does not fulfills the purpose of the question – luiscla27 May 12 '20 at 17:04