Releasing from Source Control

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Releasing from Source Control

Postby ChrisGodfree » Thu May 10, 2012 9:12 am

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>
<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
ChrisGodfree
 
Posts: 7
Joined: Thu May 10, 2012 9:02 am

Postby andy.campbell.smith » Thu May 10, 2012 11:12 am

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
andy.campbell.smith
 
Posts: 173
Joined: Thu Oct 20, 2011 11:19 am
Location: Red Gate Software

Postby andy.campbell.smith » Thu May 10, 2012 11:46 am

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
andy.campbell.smith
 
Posts: 173
Joined: Thu Oct 20, 2011 11:19 am
Location: Red Gate Software


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests