Releasing from Source Control

ChrisGodfreeChrisGodfree Posts: 11
Due to the restricted access we have to update our UAT and Production servers (by policy we have 'near to' db_owner rights) we cannot execute the SQL statements which add database-level extended properties:

/*
Start of RedGate SQL Source Control versioning database-level extended properties.
*/
DECLARE @RG_SC_VERSION BIGINT
SET @RG_SC_VERSION = 366
IF EXISTS (SELECT 1 FROM fn_listextendedproperty(N'SQLSourceControl Database Revision', NULL, NULL, NULL, NULL, NULL, NULL))
EXEC sp_dropextendedproperty N'SQLSourceControl Database Revision', NULL, NULL, NULL, NULL, NULL, NULL
EXEC sp_addextendedproperty N'SQLSourceControl Database Revision', @RG_SC_VERSION, NULL, NULL, NULL, NULL, NULL, NULL
GO
IF EXISTS (SELECT 1 FROM fn_listextendedproperty(N'SQLSourceControl Scripts Location', NULL, NULL, NULL, NULL, NULL, NULL))
EXEC sp_dropextendedproperty N'SQLSourceControl Scripts Location', NULL, NULL, NULL, NULL, NULL, NULL
EXEC sp_addextendedproperty N'SQLSourceControl Scripts Location', N'<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCompareLocation version="1" type="TfsLocation">
<ServerUrl>http://lonms07116:8080/tfs/application</ServerUrl&gt;
<SourceControlFolder>$/VoRBSGTestProject/ChrisG/Database/Test4</SourceControlFolder>
</ISOCCompareLocation>', NULL, NULL, NULL, NULL, NULL, NULL
GO
IF EXISTS (SELECT 1 FROM fn_listextendedproperty(N'SQLSourceControl Migration Scripts Location', NULL, NULL, NULL, NULL, NULL, NULL))
EXEC sp_dropextendedproperty N'SQLSourceControl Migration Scripts Location', NULL, NULL, NULL, NULL, NULL, NULL
GO
/*
End of RedGate SQL Source Control versioning database-level extended properties.
*/


Apart from manully editing the script, is there any way to remove this statement automatically?

Thanks, Chris

Comments

  • You could check the 'Ignore extended properties' option in the project options, but that'll also cut out object-level extended properties. If it's just the database properties you want to remove from the script, I'm afraid that's probably going to require hand-editing.
    Andy Campbell Smith

    Red Gate Technical Support Engineer
  • Just a brief addendum - looking at your code, this actually looks like it was generated by SQL Compare, not SQL Data Compare. You might have some luck checking the 'Ignore migration scripts for databases' option in SQL Compare, if that's the case.
    Andy Campbell Smith

    Red Gate Technical Support Engineer
Sign In or Register to comment.