I have to find a way to do a scheduled sync of a large table, that only compares the last 60 days of data rows.
I can do this manually with your product using the filter and putting in actual dates. However I don't know how to do it with either date parameters or using code like date() - 60, in a scheduled script that gets run automatically.
Is there a way to do date calculations for the filter in the script?
Thanks for the help!
command line data sync using dynamic dates in the filter
Re: command line data sync using dynamic dates in the filter
1. You can set filter, for example:
date_column > GETDATE()-60
2. Generate a *.dcomp data comparison document with the GUI of dbForge and use it in the command line interface that you can invoke from, for example, Windows Task Scheduler. Here is an example of the command line string:
dbforgesql.com /datacompare /compfile:d:\dcomp_file.dcomp /sync
Please also see the 'How To: Compare and Synchronize Data through the Command Line' topic in the product's Help documentation and the following articles on our website:
http://blogs.devart.com/dbforge/how-to- ... ndows.html
http://www.devart.com/dbforge/mysql/stu ... ackup.html
date_column > GETDATE()-60
2. Generate a *.dcomp data comparison document with the GUI of dbForge and use it in the command line interface that you can invoke from, for example, Windows Task Scheduler. Here is an example of the command line string:
dbforgesql.com /datacompare /compfile:d:\dcomp_file.dcomp /sync
Please also see the 'How To: Compare and Synchronize Data through the Command Line' topic in the product's Help documentation and the following articles on our website:
http://blogs.devart.com/dbforge/how-to- ... ndows.html
http://www.devart.com/dbforge/mysql/stu ... ackup.html
Re: command line data sync using dynamic dates in the filter
Thanks,
Is there a reference anywhere that I can use to see what commands are available in the scripts? I've seen the ones for options and settings, but they don't cover other commands like GETDATE().
Thanks again!!
Is there a reference anywhere that I can use to see what commands are available in the scripts? I've seen the ones for options and settings, but they don't cover other commands like GETDATE().
Thanks again!!
Re: command line data sync using dynamic dates in the filter
Just would like to clarify that date_column > GETDATE()-60 can be specified in the filter for a table in the GUI. Then, you start data compare and save the generated *.dcomp document that can be used afterwards in the command line.
All the commands available in the command line interface are described in the product's Help documentation. You can also obtain help by typing the following in the command line prompt:
dbforgesql.com /?
-or-
dbforgesql.com /datacompare /?
All the commands available in the command line interface are described in the product's Help documentation. You can also obtain help by typing the following in the command line prompt:
dbforgesql.com /?
-or-
dbforgesql.com /datacompare /?
Re: command line data sync using dynamic dates in the filter
Got it. But I haven't seen GETDATE() in any of the documentation yet, so I was wondering if there was any documentation showing other commands that can be used in the filter or possibly elsewhere. Just trying to see what is available.
Re: command line data sync using dynamic dates in the filter
You can add in the filter whatever SQL Server allows using in the WHERE filter
http://msdn.microsoft.com/library/dn198336.aspx
http://msdn.microsoft.com/library/dn198336.aspx