Comments
7 comments
-
You might find that SQL Compare produces less refreshview statements if you create the script through the GUI (or if you need to use the command line, create a project in the GUI, save the project, and use the /pr: switch on the command line to use the project to generate the script).
The extra view refreshes are a known issue (SC-4542) which we'll hopefully get fixed soon. -
Michelle Taylor wrote:You might find that SQL Compare produces less refreshview statements if you create the script through the GUI (or if you need to use the command line, create a project in the GUI, save the project, and use the /pr: switch on the command line to use the project to generate the script).
The extra view refreshes are a known issue (SC-4542) which we'll hopefully get fixed soon.
Ok thankyou, I am trying the /pr switch
The GUI project finds differences ok.
When using /pr switch however I receive message :
Error: The selected objects are identical or no objects have been selected in the comparison. -
brigzy wrote:Michelle Taylor wrote:You might find that SQL Compare produces less refreshview statements if you create the script through the GUI (or if you need to use the command line, create a project in the GUI, save the project, and use the /pr: switch on the command line to use the project to generate the script).
The extra view refreshes are a known issue (SC-4542) which we'll hopefully get fixed soon.
Ok thankyou, I am trying the /pr switch
The GUI project finds differences ok.
When using /pr switch however I receive message :
Error: The selected objects are identical or no objects have been selected in the comparison.
Here is the project contents:<?xml version="1.0" encoding="utf-8" standalone="yes"?><!-- SQL Compare SQL Compare 8 Version:8.1.0.360--><Project version="1" type="SQLComparisonToolsProject"><DataSource1 version="2" type="LiveDatabaseSource"><ServerName>PARTNER-DEV</ServerName><DatabaseName>RDB_PARTNER_CHALL</DatabaseName><Username /><SavePassword>False</SavePassword><Password /><IntegratedSecurity>True</IntegratedSecurity></DataSource1><DataSource2 version="2" type="LiveDatabaseSource"><ServerName>PARTNER</ServerName><DatabaseName>PARTNER_CHALL</DatabaseName><Username /><SavePassword>False</SavePassword><Password /><IntegratedSecurity>True</IntegratedSecurity></DataSource2><LastCompared>09/24/2009 14:40:33</LastCompared><Options>317002946838538</Options><InRecycleBin>False</InRecycleBin><Direction>0</Direction><ProjectFilter version="1" type="DifferenceFilter"><FilterCaseSensitive>False</FilterCaseSensitive><Filters version="1"><None version="1"><Include>True</Include><Expression>TRUE</Expression></None><Assembly version="1"><Include>True</Include><Expression>TRUE</Expression></Assembly><AsymmetricKey version="1"><Include>True</Include><Expression>TRUE</Expression></AsymmetricKey><Certificate version="1"><Include>True</Include><Expression>TRUE</Expression></Certificate><Contract version="1"><Include>True</Include><Expression>TRUE</Expression></Contract><DdlTrigger version="1"><Include>True</Include><Expression>TRUE</Expression></DdlTrigger><Default version="1"><Include>True</Include><Expression>TRUE</Expression></Default><EventNotification version="1"><Include>True</Include><Expression>TRUE</Expression></EventNotification><FullTextCatalog version="1"><Include>True</Include><Expression>TRUE</Expression></FullTextCatalog><FullTextStoplist version="1"><Include>True</Include><Expression>TRUE</Expression></FullTextStoplist><Function version="1"><Include>True</Include><Expression>TRUE</Expression></Function><MessageType version="1"><Include>True</Include><Expression>TRUE</Expression></MessageType><PartitionFunction version="1"><Include>True</Include><Expression>TRUE</Expression></PartitionFunction><PartitionScheme version="1"><Include>True</Include><Expression>TRUE</Expression></PartitionScheme><Queue version="1"><Include>True</Include><Expression>TRUE</Expression></Queue><Role version="1"><Include>True</Include><Expression>TRUE</Expression></Role><Route version="1"><Include>True</Include><Expression>TRUE</Expression></Route><Rule version="1"><Include>True</Include><Expression>TRUE</Expression></Rule><Schema version="1"><Include>True</Include><Expression>TRUE</Expression></Schema><Service version="1"><Include>True</Include><Expression>TRUE</Expression></Service><ServiceBinding version="1"><Include>True</Include><Expression>TRUE</Expression></ServiceBinding><StoredProcedure version="1"><Include>True</Include><Expression>TRUE</Expression></StoredProcedure><SymmetricKey version="1"><Include>True</Include><Expression>TRUE</Expression></SymmetricKey><Synonym version="1"><Include>True</Include><Expression>TRUE</Expression></Synonym><Table version="1"><Include>True</Include><Expression>TRUE</Expression></Table><User version="1"><Include>True</Include><Expression>TRUE</Expression></User><UserDefinedType version="1"><Include>True</Include><Expression>TRUE</Expression></UserDefinedType><View version="1"><Include>True</Include><Expression>TRUE</Expression></View><XmlSchemaCollection version="1"><Include>True</Include><Expression>TRUE</Expression></XmlSchemaCollection></Filters></ProjectFilter><ProjectFilterName /><UserNote /><SelectedSyncObjects version="1" type="SelectedSyncObjects"><Schemas type="ListString" version="2"><value type="string">ZABiAG8A</value></Schemas><ZABiAG8A>xHHnGKCjdJcKPDjJpAbtLAICAPVvHeWVTco3IsGYU+jVlpoCAgDSHfGSAHcQMlchk6+h8AX2AgIAeRG7MhHrGx1o6YozUaTJ/AMCAA__</ZABiAG8A><Grouping type="ListByte" version="2"><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value></Grouping><SelectAll>False</SelectAll></SelectedSyncObjects><SCGroupingStyle>0</SCGroupingStyle><SQLOptions>266</SQLOptions><MappingOptions>82</MappingOptions><ComparisonOptions>0</ComparisonOptions><TableActions type="ArrayList" version="1" /><SessionSettings>15</SessionSettings><DCGroupingStyle>0</DCGroupingStyle></Project>
and here is my command line"C:\Program Files\Red Gate\SQL Compare 8\sqlcompare.exe" /pr:"RDB_DEV_PROD.scp" /scriptfile:"C:\Program Files\SQL Release\SQL Scripts\SQL Scripts RDB\A0000 SQLCompare.sql" /force
-
brigzy wrote:brigzy wrote:Michelle Taylor wrote:You might find that SQL Compare produces less refreshview statements if you create the script through the GUI (or if you need to use the command line, create a project in the GUI, save the project, and use the /pr: switch on the command line to use the project to generate the script).
The extra view refreshes are a known issue (SC-4542) which we'll hopefully get fixed soon.
Ok thankyou, I am trying the /pr switch
The GUI project finds differences ok.
When using /pr switch however I receive message :
Error: The selected objects are identical or no objects have been selected in the comparison.
Here is the project contents:<?xml version="1.0" encoding="utf-8" standalone="yes"?><!-- SQL Compare SQL Compare 8 Version:8.1.0.360--><Project version="1" type="SQLComparisonToolsProject"><DataSource1 version="2" type="LiveDatabaseSource"><ServerName>PARTNER-DEV</ServerName><DatabaseName>RDB_PARTNER_CHALL</DatabaseName><Username /><SavePassword>False</SavePassword><Password /><IntegratedSecurity>True</IntegratedSecurity></DataSource1><DataSource2 version="2" type="LiveDatabaseSource"><ServerName>PARTNER</ServerName><DatabaseName>PARTNER_CHALL</DatabaseName><Username /><SavePassword>False</SavePassword><Password /><IntegratedSecurity>True</IntegratedSecurity></DataSource2><LastCompared>09/24/2009 14:40:33</LastCompared><Options>317002946838538</Options><InRecycleBin>False</InRecycleBin><Direction>0</Direction><ProjectFilter version="1" type="DifferenceFilter"><FilterCaseSensitive>False</FilterCaseSensitive><Filters version="1"><None version="1"><Include>True</Include><Expression>TRUE</Expression></None><Assembly version="1"><Include>True</Include><Expression>TRUE</Expression></Assembly><AsymmetricKey version="1"><Include>True</Include><Expression>TRUE</Expression></AsymmetricKey><Certificate version="1"><Include>True</Include><Expression>TRUE</Expression></Certificate><Contract version="1"><Include>True</Include><Expression>TRUE</Expression></Contract><DdlTrigger version="1"><Include>True</Include><Expression>TRUE</Expression></DdlTrigger><Default version="1"><Include>True</Include><Expression>TRUE</Expression></Default><EventNotification version="1"><Include>True</Include><Expression>TRUE</Expression></EventNotification><FullTextCatalog version="1"><Include>True</Include><Expression>TRUE</Expression></FullTextCatalog><FullTextStoplist version="1"><Include>True</Include><Expression>TRUE</Expression></FullTextStoplist><Function version="1"><Include>True</Include><Expression>TRUE</Expression></Function><MessageType version="1"><Include>True</Include><Expression>TRUE</Expression></MessageType><PartitionFunction version="1"><Include>True</Include><Expression>TRUE</Expression></PartitionFunction><PartitionScheme version="1"><Include>True</Include><Expression>TRUE</Expression></PartitionScheme><Queue version="1"><Include>True</Include><Expression>TRUE</Expression></Queue><Role version="1"><Include>True</Include><Expression>TRUE</Expression></Role><Route version="1"><Include>True</Include><Expression>TRUE</Expression></Route><Rule version="1"><Include>True</Include><Expression>TRUE</Expression></Rule><Schema version="1"><Include>True</Include><Expression>TRUE</Expression></Schema><Service version="1"><Include>True</Include><Expression>TRUE</Expression></Service><ServiceBinding version="1"><Include>True</Include><Expression>TRUE</Expression></ServiceBinding><StoredProcedure version="1"><Include>True</Include><Expression>TRUE</Expression></StoredProcedure><SymmetricKey version="1"><Include>True</Include><Expression>TRUE</Expression></SymmetricKey><Synonym version="1"><Include>True</Include><Expression>TRUE</Expression></Synonym><Table version="1"><Include>True</Include><Expression>TRUE</Expression></Table><User version="1"><Include>True</Include><Expression>TRUE</Expression></User><UserDefinedType version="1"><Include>True</Include><Expression>TRUE</Expression></UserDefinedType><View version="1"><Include>True</Include><Expression>TRUE</Expression></View><XmlSchemaCollection version="1"><Include>True</Include><Expression>TRUE</Expression></XmlSchemaCollection></Filters></ProjectFilter><ProjectFilterName /><UserNote /><SelectedSyncObjects version="1" type="SelectedSyncObjects"><Schemas type="ListString" version="2"><value type="string">ZABiAG8A</value></Schemas><ZABiAG8A>xHHnGKCjdJcKPDjJpAbtLAICAPVvHeWVTco3IsGYU+jVlpoCAgDSHfGSAHcQMlchk6+h8AX2AgIAeRG7MhHrGx1o6YozUaTJ/AMCAA__</ZABiAG8A><Grouping type="ListByte" version="2"><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value><value type="Byte">0</value></Grouping><SelectAll>False</SelectAll></SelectedSyncObjects><SCGroupingStyle>0</SCGroupingStyle><SQLOptions>266</SQLOptions><MappingOptions>82</MappingOptions><ComparisonOptions>0</ComparisonOptions><TableActions type="ArrayList" version="1" /><SessionSettings>15</SessionSettings><DCGroupingStyle>0</DCGroupingStyle></Project>
and here is my command line"C:\Program Files\Red Gate\SQL Compare 8\sqlcompare.exe" /pr:"RDB_DEV_PROD.scp" /scriptfile:"C:\Program Files\SQL Release\SQL Scripts\SQL Scripts RDB\A0000 SQLCompare.sql" /force
Hi Michelle
can I ask if the above /pr is a known issue?
Is there a previous (older vserion) of SQLCompare, perhaps without the issue I could use meanwhile?
Many thanks -
I found problem is caused when a new project is created, the compare is run, but the Sync Wizard has not been run.
So I am over that hurdle and now the script is created just fine.
Indeed the /pr aproach has removed all the unwanted sp_refreshview statements from the scripts. -
I find there are a number of views that error when sp_refreshview is called, it would be really useful to be able to disable refresh of particular views.
Please could be logged as an enhancement request? -
Hi there
I think this behaviour is improved in our latest Frequent Updates release (11.1.7.47) - Compare should now refresh views less often; it will no longer refresh views unrelated to the deployment and will refresh no views if the 'Include Dependencies' option is disabled
Add comment
Please sign in to leave a comment.
I am having trouble as sp_referesh view is included in the script generated by SQLCompare command line.
When running the script on the destination server\database, the script errors as the view refferes to a 'another' database that is not on the destination server.
The generated script is creating an sp_refresh for every view in the database? which is odd as there are only 4 ddl changes (one SP, three table structure changes).
Can I disable the sp_refreshview behaviour?
Attched is generated SQL script