Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Monday, March 19, 2012

Compare two databases and update objects?

Is there a way to compare two databases one being an old
database and the second being a new database, I will
update the old database's objects to match the new database's
objects?

Is there SQL code that could do this easily?

How do you do this if you deal with the same scenario?

Thank youserge (sergea@.nospam.ehmail.com) writes:
> Is there a way to compare two databases one being an old
> database and the second being a new database, I will
> update the old database's objects to match the new database's
> objects?
> Is there SQL code that could do this easily?

The standard recommendation is to look at SQL Compare from Red Gate.

> How do you do this if you deal with the same scenario?

I'm avoiding it by having my code under version control, and keeping
track of what I shipped. Our load tool actuall has its own set of tables
to do this.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||DB Ghost is a tool that will compare databases and upgrade a target
database to make it match a source.

It also integrates with any source control system so the 'source'
database becomes a simple set of drop/create scripts. The power of
this approach is that it enables any size of development team to work
on the schema under source control at the same time using the same
mechanism that they do for other application code such as C#, Java, VB,
C++ etc. This provides you with a full audit trail of who made what
changes to the schema, when and why.

This process is one that delivers more as your development needs
increase. For example it doesn't matter how many developers work on
the scripts in source control, the amount of time required to extract
all the scripts and perform the upgrade doesn't noticeably increase.
Also, this process works perfectly with parallel development as it
means that concepts such as isolated worksets and merges between code
lines becomes as easy as it is with normal application code. Try doing
parallel development with delta scripts, it is a completely error prone
manual process of looking through the delta scripts to work out what
has been changed!

Diff tools such as SQL Compare are great at what they do but,
ultimately, they are really just there to get you out of trouble.

This trouble is normally caused by not having proper processes and
tools to control changes to your schema.

DB Ghost plus any source control system gives you such a process.

Malcolm
www.dbghost.com
Build, Compare and Synchronize = Database Change Management for SQL
Server

Thursday, March 8, 2012

Compare and Restore Tables

I have a database with 44 user tables that had some data deleted. I have
a 2 month old backup of the .mdf and .ldf files I can reatach to the
Server (not the proper sql backup wizard method).

Is there a way I can compare the data that is in the old database to the
new and pull in the records from the old that don't exist in new
database?

Thanks,
Steve

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!Hi

Using the INFORMATION_SCHEMA views you can write a script that uses the PKs
for each table to insert into the new table that does not already exist in
the table already.

John
"Steve Bishop" <steveb@.viper.com> wrote in message
news:40eefab0$0$16477$c397aba@.news.newsgroups.ws.. .
> I have a database with 44 user tables that had some data deleted. I have
> a 2 month old backup of the .mdf and .ldf files I can reatach to the
> Server (not the proper sql backup wizard method).
> Is there a way I can compare the data that is in the old database to the
> new and pull in the records from the old that don't exist in new
> database?
> Thanks,
> Steve
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!

Tuesday, February 14, 2012

Command to clear DTS Package Logs + Versions

Hello. Is there any command that you can clear old DTS
package execution Logs? Also, when you store packages as
*.dts files, it saves the versions right in the file. Is
there a command that can clear older versions, either ALL
of them, or say, after 30 days?!? I know these things
can be done manully thru the GUI, looking for a way to
automate it if possible. Thanks, BruceRegarding the structured storage files, we always delete the existing DTS
file before saving so the file only contains one version. We keep the
packages under source control for versioning.
Hope this helps.
Dan Guzman
SQL Server MVP
"Bruce de Freitas" <bruce@.defreitas.com> wrote in message
news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
> Hello. Is there any command that you can clear old DTS
> package execution Logs? Also, when you store packages as
> *.dts files, it saves the versions right in the file. Is
> there a command that can clear older versions, either ALL
> of them, or say, after 30 days?!? I know these things
> can be done manully thru the GUI, looking for a way to
> automate it if possible. Thanks, Bruce|||And in terms of the package logs, you would need to write
your own utility using the DTS Object model. Search books
online for the RemovePackageLogRecords method. In terms of
deleting based on dates, the package log date is tied to the
PackageLogRecord object.
-Sue
On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
<bruce@.defreitas.com> wrote:

>Hello. Is there any command that you can clear old DTS
>package execution Logs? Also, when you store packages as
>*.dts files, it saves the versions right in the file. Is
>there a command that can clear older versions, either ALL
>of them, or say, after 30 days?!? I know these things
>can be done manully thru the GUI, looking for a way to
>automate it if possible. Thanks, Bruce|||Thanks Dan, was hoping there was some automated
method/command of clearing the old versions, as they
exist already on numerous packages. Doesn't sound it.
THanks, Bruce
>--Original Message--
>Regarding the structured storage files, we always delete
the existing DTS
>file before saving so the file only contains one
version. We keep the
>packages under source control for versioning.
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>"Bruce de Freitas" <bruce@.defreitas.com> wrote in
message
>news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
as[vbcol=seagreen]
Is[vbcol=seagreen]
ALL[vbcol=seagreen]
>
>.
>|||ok Sue, intersting stuff. We'll check it out. THanks,
Bruce
>--Original Message--
>And in terms of the package logs, you would need to write
>your own utility using the DTS Object model. Search books
>online for the RemovePackageLogRecords method. In terms
of
>deleting based on dates, the package log date is tied to
the
>PackageLogRecord object.
>-Sue
>On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
><bruce@.defreitas.com> wrote:
>
as[vbcol=seagreen]
Is[vbcol=seagreen]
ALL[vbcol=seagreen]
>.
>

Command to clear DTS Package Logs + Versions

Hello. Is there any command that you can clear old DTS
package execution Logs? Also, when you store packages as
*.dts files, it saves the versions right in the file. Is
there a command that can clear older versions, either ALL
of them, or say, after 30 days?!? I know these things
can be done manully thru the GUI, looking for a way to
automate it if possible. Thanks, Bruce
Regarding the structured storage files, we always delete the existing DTS
file before saving so the file only contains one version. We keep the
packages under source control for versioning.
Hope this helps.
Dan Guzman
SQL Server MVP
"Bruce de Freitas" <bruce@.defreitas.com> wrote in message
news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
> Hello. Is there any command that you can clear old DTS
> package execution Logs? Also, when you store packages as
> *.dts files, it saves the versions right in the file. Is
> there a command that can clear older versions, either ALL
> of them, or say, after 30 days?!? I know these things
> can be done manully thru the GUI, looking for a way to
> automate it if possible. Thanks, Bruce
|||And in terms of the package logs, you would need to write
your own utility using the DTS Object model. Search books
online for the RemovePackageLogRecords method. In terms of
deleting based on dates, the package log date is tied to the
PackageLogRecord object.
-Sue
On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
<bruce@.defreitas.com> wrote:

>Hello. Is there any command that you can clear old DTS
>package execution Logs? Also, when you store packages as
>*.dts files, it saves the versions right in the file. Is
>there a command that can clear older versions, either ALL
>of them, or say, after 30 days?!? I know these things
>can be done manully thru the GUI, looking for a way to
>automate it if possible. Thanks, Bruce
|||Thanks Dan, was hoping there was some automated
method/command of clearing the old versions, as they
exist already on numerous packages. Doesn't sound it.
THanks, Bruce
>--Original Message--
>Regarding the structured storage files, we always delete
the existing DTS
>file before saving so the file only contains one
version. We keep the
>packages under source control for versioning.
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>"Bruce de Freitas" <bruce@.defreitas.com> wrote in
message[vbcol=seagreen]
>news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
as[vbcol=seagreen]
Is[vbcol=seagreen]
ALL
>
>.
>
|||ok Sue, intersting stuff. We'll check it out. THanks,
Bruce
>--Original Message--
>And in terms of the package logs, you would need to write
>your own utility using the DTS Object model. Search books
>online for the RemovePackageLogRecords method. In terms
of
>deleting based on dates, the package log date is tied to
the[vbcol=seagreen]
>PackageLogRecord object.
>-Sue
>On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
><bruce@.defreitas.com> wrote:
as[vbcol=seagreen]
Is[vbcol=seagreen]
ALL
>.
>

Command to clear DTS Package Logs + Versions

Hello. Is there any command that you can clear old DTS
package execution Logs? Also, when you store packages as
*.dts files, it saves the versions right in the file. Is
there a command that can clear older versions, either ALL
of them, or say, after 30 days?!? I know these things
can be done manully thru the GUI, looking for a way to
automate it if possible. Thanks, BruceRegarding the structured storage files, we always delete the existing DTS
file before saving so the file only contains one version. We keep the
packages under source control for versioning.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Bruce de Freitas" <bruce@.defreitas.com> wrote in message
news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
> Hello. Is there any command that you can clear old DTS
> package execution Logs? Also, when you store packages as
> *.dts files, it saves the versions right in the file. Is
> there a command that can clear older versions, either ALL
> of them, or say, after 30 days?!? I know these things
> can be done manully thru the GUI, looking for a way to
> automate it if possible. Thanks, Bruce|||And in terms of the package logs, you would need to write
your own utility using the DTS Object model. Search books
online for the RemovePackageLogRecords method. In terms of
deleting based on dates, the package log date is tied to the
PackageLogRecord object.
-Sue
On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
<bruce@.defreitas.com> wrote:
>Hello. Is there any command that you can clear old DTS
>package execution Logs? Also, when you store packages as
>*.dts files, it saves the versions right in the file. Is
>there a command that can clear older versions, either ALL
>of them, or say, after 30 days?!? I know these things
>can be done manully thru the GUI, looking for a way to
>automate it if possible. Thanks, Bruce|||Thanks Dan, was hoping there was some automated
method/command of clearing the old versions, as they
exist already on numerous packages. Doesn't sound it.
THanks, Bruce
>--Original Message--
>Regarding the structured storage files, we always delete
the existing DTS
>file before saving so the file only contains one
version. We keep the
>packages under source control for versioning.
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>"Bruce de Freitas" <bruce@.defreitas.com> wrote in
message
>news:3bc501c51fff$3d0b4f00$a601280a@.phx.gbl...
>> Hello. Is there any command that you can clear old DTS
>> package execution Logs? Also, when you store packages
as
>> *.dts files, it saves the versions right in the file.
Is
>> there a command that can clear older versions, either
ALL
>> of them, or say, after 30 days?!? I know these things
>> can be done manully thru the GUI, looking for a way to
>> automate it if possible. Thanks, Bruce
>
>.
>|||ok Sue, intersting stuff. We'll check it out. THanks,
Bruce
>--Original Message--
>And in terms of the package logs, you would need to write
>your own utility using the DTS Object model. Search books
>online for the RemovePackageLogRecords method. In terms
of
>deleting based on dates, the package log date is tied to
the
>PackageLogRecord object.
>-Sue
>On Thu, 3 Mar 2005 06:42:35 -0800, "Bruce de Freitas"
><bruce@.defreitas.com> wrote:
>>Hello. Is there any command that you can clear old DTS
>>package execution Logs? Also, when you store packages
as
>>*.dts files, it saves the versions right in the file.
Is
>>there a command that can clear older versions, either
ALL
>>of them, or say, after 30 days?!? I know these things
>>can be done manully thru the GUI, looking for a way to
>>automate it if possible. Thanks, Bruce
>.
>