Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Tuesday, March 20, 2012

Recover lost data after wrong backup restored

I have accidently restored a SQL database (using Force restore over existing
database in EM) using a backup which was 1 month older than the latest
backup, and have therefore lost some important data from the existing
database. Is there any way that I can recover the lost data?
Thanks for any help.Seen from SQL Server's viewpoint, the data has been physically overwritten.
Either hunt down a later backup, or see of there is any OS or possibly SAN level utility that might
help you here (I wouldn't have much hope for this but think it is at least worth mentioning).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Williams" <johnwilliams_esquire@.NOhotmailSPAM.com> wrote in message
news:uSRIcb5rEHA.536@.TK2MSFTNGP11.phx.gbl...
>I have accidently restored a SQL database (using Force restore over existing
> database in EM) using a backup which was 1 month older than the latest
> backup, and have therefore lost some important data from the existing
> database. Is there any way that I can recover the lost data?
> Thanks for any help.
>
>

Friday, March 9, 2012

Recover data with updated transaction Log only

I am newbie in MS SQL Server, today I wrongly run a script to clear all data of a table, and the backup is one month ago. Can I just use the existing transaction log to rollback what I have done today? If yes, how to do so.
The data is very important, please help.
Regards,
Thomas
If you are using the FULL recovery model, you can backup your transaction
log, restore the database (perhaps with a different name or server) and
apply the log up to the point of the problem. You can then extract the lost
data.
Your only other option is to use a utility like Log Explorer
www.lumigent.com to recover data from the log, if it is available.
Hope this helps.
Dan Guzman
SQL Server MVP
"Thomas Tsang" <thomast@.hkc.net> wrote in message
news:O1hYtVylEHA.2492@.TK2MSFTNGP15.phx.gbl...
I am newbie in MS SQL Server, today I wrongly run a script to clear all data
of a table, and the backup is one month ago. Can I just use the existing
transaction log to rollback what I have done today? If yes, how to do so.
The data is very important, please help.
Regards,
Thomas
|||I can retored the data that is one month ago, but what I need is the current
data.
I have readingthe doc about Log Explorer, but how can I check if the data is
still available in the log and can be recovered by the Log Explorer?
Regards,
Thomas
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23DZrzhylEHA.3476@.tk2msftngp13.phx.gbl g...
> If you are using the FULL recovery model, you can backup your transaction
> log, restore the database (perhaps with a different name or server) and
> apply the log up to the point of the problem. You can then extract the
lost
> data.
> Your only other option is to use a utility like Log Explorer
> www.lumigent.com to recover data from the log, if it is available.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Thomas Tsang" <thomast@.hkc.net> wrote in message
> news:O1hYtVylEHA.2492@.TK2MSFTNGP15.phx.gbl...
> I am newbie in MS SQL Server, today I wrongly run a script to clear all
data
> of a table, and the backup is one month ago. Can I just use the existing
> transaction log to rollback what I have done today? If yes, how to do so.
> The data is very important, please help.
> Regards,
> Thomas
>
|||You'll need to run the utility to see if it is still available.
Hope this helps.
Dan Guzman
SQL Server MVP
"Thomas Tsang" <thomast@.hkc.net> wrote in message
news:uXa0GsylEHA.1656@.TK2MSFTNGP09.phx.gbl...
>I can retored the data that is one month ago, but what I need is the
>current
> data.
> I have readingthe doc about Log Explorer, but how can I check if the data
> is
> still available in the log and can be recovered by the Log Explorer?
> Regards,
> Thomas
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
> news:%23DZrzhylEHA.3476@.tk2msftngp13.phx.gbl g...
> lost
> data
>
|||i know, but the trial version of Log Explorer is restricted to access my
database and the log...
Any ideas?
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:ukfRFyylEHA.3544@.TK2MSFTNGP15.phx.gbl g...[vbcol=seagreen]
> You'll need to run the utility to see if it is still available.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Thomas Tsang" <thomast@.hkc.net> wrote in message
> news:uXa0GsylEHA.1656@.TK2MSFTNGP09.phx.gbl...
data[vbcol=seagreen]
transaction[vbcol=seagreen]
existing
>
|||You can get an idea of whats in the log using the undocumented fn_dblog
system function:
SELECT * FROM ::fn_dblog(null, null)
Hope this helps.
Dan Guzman
SQL Server MVP
"Thomas Tsang" <thomast@.hkc.net> wrote in message
news:%23hnAi6ylEHA.1244@.TK2MSFTNGP15.phx.gbl...
>i know, but the trial version of Log Explorer is restricted to access my
> database and the log...
> Any ideas?
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
> news:ukfRFyylEHA.3544@.TK2MSFTNGP15.phx.gbl g...
> data
> transaction
> existing
>
|||Thx for your information, and the attached is the return data. I find that
the value of the column Checkpoint Begin in first record is match with the
time i start execute the wrong query, does it mean that the data can be get
back using Log Explorer?
Regards,
Thomas
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23MiraJzlEHA.1672@.TK2MSFTNGP14.phx.gbl g...[vbcol=seagreen]
> You can get an idea of whats in the log using the undocumented fn_dblog
> system function:
> SELECT * FROM ::fn_dblog(null, null)
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Thomas Tsang" <thomast@.hkc.net> wrote in message
> news:%23hnAi6ylEHA.1244@.TK2MSFTNGP15.phx.gbl...
do
>
|||Attached file missing in previous mail...
"Thomas Tsang" <thomast@.hkc.net> bl
news:emIuHXzlEHA.2492@.TK2MSFTNGP15.phx.gbl g...
> Thx for your information, and the attached is the return data. I find
that
> the value of the column Checkpoint Begin in first record is match with the
> time i start execute the wrong query, does it mean that the data can be
get[vbcol=seagreen]
> back using Log Explorer?
> Regards,
> Thomas
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
> news:%23MiraJzlEHA.1672@.TK2MSFTNGP14.phx.gbl g...
my[vbcol=seagreen]
the[vbcol=seagreen]
Explorer?[vbcol=seagreen]
server)[vbcol=seagreen]
extract[vbcol=seagreen]
clear[vbcol=seagreen]
to
> do
>
begin 666 result.txt
M0W5R<F5N="!,4TX@.(" @.(" @.(" @.("!/<&5R871I;VX@.(" @.(" @.(" @.(" @.
M(" @.($-O;G1E>'0@.(" @.(" @.(" @.(" @.(" @.(" @.5')A;G-A8W1I;VX@.240@.
M5&%G($)I=',@.3&]G(%)E8V]R9"!,96YG=&@.@.4')E=FEO=7,@.3%-.(" @.(" @.
M(" @.("!&;&%G($)I=',@.3V)J96-T($YA;64@.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M("!);F1E>"!.86UE(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.4&%G92!)1" @.(" @.("!3;&]T($E$(%!R979I;W5S(%!A9V4@.
M3%-.(" @.(" @.3V9F<V5T(&EN(%)O=R!.=6T@.16QE;65N=',@.16QE;65N="!%
M;&5M96YT($QE;F=T:"!/9F9S970@.4F]W($1A=&$@.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.($-H96-K<&]I;G0@.0F5G:6X@.(" @.(" @.($-(2U!4($)E9VEN
M($1"(%9E<G-I;VX@.36%X(%A$15-)1" @.(" @.3G5M(%1R86YS86-T:6]N<R!4
M<F%N<V%C=&EO;B!#='(@.5')A;G-A8W1I;VX@.240@.:6X@.0TA+4%0@.5')A;G-A
M8W1I;VX@.4W1A='5S($-(2U!4($)E9VEN($Q33B @.(" @.(" @.5')A;G-A8W1I
M;VX@.4W1A=&4@.(" @.5')A;G-A8W1I;VX@.5'EP92!,87-T($Q33B @.(" @.(" @.
M(" @.(" @.(%)E8V]R9"!#;W5N="!">71E<R!5<V5D("!">71E<R!297-E<G9E
M9"!#:&5C:W!O:6YT($5N9" @.(" @.(" @.("!#2$M05"!%;F0@.1$(@.5F5R<VEO
M;B!-:6YI;75M($Q33B @.(" @.(" @.(" @.($1I<G1Y(%!A9V5S($]L9&5S="!2
M97!L:6-A=&5D($)E9VEN($Q33B!.97AT(%)E<&QI8V%T960@.16YD($Q33 B!,
M87-T($1I<W1R:6)U=&5D($)A8VMU<"!%;F0@.3%-.($QA<W0@.1&ES=')I8G5T
M960@.16YD($Q33B!397)V97(@.54E$("!5240@.(" @.(" @.("!34$E$(" @.(" @.
M("!"96=I;FQO9R!3=&%T=7,@.0F5G:6X@.5&EM92 @.(" @.(" @.(" @.(" @.5')A
M;G-A8W1I;VX@.3F%M92 @.(" @.16YD(%1I;64@.(" @.(" @.(" @.(" @.(" @.5')A
M;G-A8W1I;VX@.0F5G:6X@.(" @.("!297!L:6-A=&5D(%)E8V]R9',@.3VQD97-T
M($%C=&EV92!,4TX@.(" @.("!397)V97(@.3F%M92 @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.("!$871A8F%S92!.86UE(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.("!-87)K($YA;64@.(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!-87-T97(@.
M6$1%4TE$("!-87-T97(@.1$))1"!0<F5P;&]G($)E9VEN($Q33B @.(" @.(%!R
M97!A<F4@.5&EM92 @.(" @.(" @.(" @.(%!R979I;W5S(%-A=F5P;VEN=" @.(" @.
M4V%V97!O:6YT($YA;64@.(" @.(" @.4F]W8FET<R!&:7)S="!":70@.4F]W8FET
M<R!":70@.0V]U;G0@.4F]W8FET<R!":70@.5F%L=64@.3%-.(&)E9F]R92!W<FET
M97,@.(" @.("!086=E<R!7<FET=&5N(%!A9V4@.0V]U;G1E<B!"=69W<FET92!0
M86=E($ED($1A=&$@.4&%G97,@.1&5L=&$@.4F5S97)V960@.4&%G9 7,@.1&5L=&$@.
M57-E9"!086=E<R!$96QT82!$871A(%)O=W,@.1&5L=&$@.0V]M;6%N9"!4>7!E
M(%!U8FQI8V%T:6]N($E$($%R=&EC;&4@.240@.(%!A<G1I86P@.4W1A='5S($-O
M;6UA;F0@.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.($)Y=&4@.3V9F
M<V5T($YE=R!686QU92!/;&0@.5F%L=64@.3F5W(%-P;&ET(%!A9V4@.4F]W<R!$
M96QE=&5D($)Y=&5S($9R965D($-)(%1A8FQE($ED($-)($EN9&5X($ED($9I
M;&5'<F]U<"!)1" -"BTM+2TM+2TM+2TM+2TM+2TM+2T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TM
M+2TM+2TM+2TM+2 M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+ 2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+ 2TM+2TM+2TM
M+2TM+2 M+2TM+2TM+2TM+2 M+2TM+2TM+2T@.+2TM+2TM+2TM("TM+2TM+2TM
M+2TM+2TM("TM+2TM+2TM+2TM+2 M+2TM+2TM+2TM+2 M+2TM+2TM+2TM+2 M
M+2TM+2TM+2TM+2 M+2TM+2TM+2TM+2T@.#0HP,# P,3,T83HP,# P,3(V8CHP
M,# Q($Q/4%]"14=)3E]#2U!4(" @.(" @.(" @.(" @.3$-87TY53$P@.(" @.(" @.
M(" @.(" @.(" @.(" P,# P.C P,# P,# P(" P># P,# @.(" Y-B @.(" @.(" @.
M(" @.(" @.(" P,# P,3,T.3HP,# P,C4X-CHP,# R(#!X,# P," @.("!.54Q,
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.
M(" @.($Y53$P@.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.
M(" @.($Y53$P@.(" @.(" @.("!.54Q,(" @.($Y53$P@.(" @.(" @.(" @.($Y53$P@.
M("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.,C P-"\P.2\Q
M," Q,CHU-3HU-#HV,#<@.-3,Y(" @.(" @.(" @.(" @.(" @.(" @.(" P,# P.C S
M-C=A-3DU("!.54Q,(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.("!.54Q,
M(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.3E5,3" @.
M(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.
M(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.
M($Y53$P@.(" @.(" @.($Y53$P@.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.
M(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.
M(" @.(" @.3E5,3" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.
M(" @.($Y53$P@.(" @.(" @.($Y53$P@.(" @.(" @.($Y53$P@.(" @.(" @.(" @.("!.
M54Q,(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.("!.
M54Q,(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.
M($Y53$P@.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.($Y5
M3$P@.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.($Y53$P@.(" @.(" @.
M($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.
M(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.
M("!.54Q,(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.("!.54Q,(" @.
M(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.
M(" @.3E5,3" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.
M(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.($Y5
M3$P@.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.3E5,
M3" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.3E5,3" @.(" @.($Y53$P@.
M(" @.("!.54Q,(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.3E5,3" @.(" @.(" @.
M3E5,3" @.(" @.(" @.3E5,3" @.(" @.(" @.3E5,3 T*,# P,#$S-&$Z,# P,#$R
M-F,Z,# P,2!,3U!?14Y$7T-+4%0@.(" @.(" @.(" @.(" @.($Q#6%].54Q,(" @.
M(" @.(" @.(" @.(" @.(" @.,# P,#HP,# P,# P," @.,'@.P,# P(" @.,3,V(" @.
M(" @.(" @.(" @.(" @.,# P,#$S-&$Z,# P,#$R-F(Z,# P,2 P># P,# @.(" @.
M3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.
M(" @.(" @.("!.54Q,(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.
M(" @.(" @.("!.54Q,(" @.(" @.(" @.3E5,3" @.("!.54Q,(" @.(" @.(" @.("!.
M54Q,(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.
M(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,
M3" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.
M3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.($Y5
M3$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.3E5,
M3" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.
M(" @.("!.54Q,(" @.(" @.("!.54Q,(" @.(" @.(" @.(" R,# T+S Y+S$P(#$R
M.C4V.C P.C(P," U,SD@.(" @.(" @.(" @.(" @.(" @.(" P,# P,3,T83HP,# P
M,3(V8CHP,# Q(#DR-2 @.(" @.(" @.(# P,# P,# P.C P,# P,# P.C P,# @.
M(" @.(" P,# P,# P,#HP,# P,# P,#HP,# P(" P,# P,# P,#HP,# P,# P
M,#HP,# P(" @.(" @.(" @.(# P,# P,# P.C P,# P,# P.C P,# @.("!.54Q,
M(" @.(" @.("!.54Q,(" @.(" @.("!.54Q,(" @.(" @.("!.54Q,(" @.(" @.(" @.
M(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.
M(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.
M(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.
M("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.(" @.(" @.("!.54Q,(" @.
M(" @.("!.54Q,(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.
M(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.
M(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.3E5,
M3" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.("!.54Q,(" @.
M(" @.(" @.($Y53$P@.(" @.(" @.("!.54Q,(" @.(" @.(" @.(" @.($Y53$P@.(" @.
M(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.(" @.
M("!.54Q,(" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.
M($Y53$P@.(" @.(" @.($Y53$P@.(" @.(" @.(" @.($Y53$P@.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.(" @.
M(" @.(" @.(" @.(" @.(" @.(" @.(" @.($Y53$P@.(" @.(" @.($Y53$P@.(" @.("!.
M54Q,(" @.(" @.3E5,3" @.(" @.(" @.(" @.3E5,3" @.(" @.(" @.($Y53$P@.(" @.
M(" @.($Y53$P@.(" @.(" @.($Y53$P@.(" @.(" @.($Y53$P-"@.T**#(@.<F]W*',I
,(&%F9F5C=&5D*0T*
`
end
|||It looks like your database is in the SIMPLE recovery model and the log was
truncated. Some of the data might still be in the log but there's no
guarantee. I don't know of a way to find out without running the utility.
Hope this helps.
Dan Guzman
SQL Server MVP
"Thomas Tsang" <thomast@.hkc.net> wrote in message
news:OUE$UbzlEHA.3428@.TK2MSFTNGP14.phx.gbl...
> Attached file missing in previous mail...
> "Thomas Tsang" <thomast@.hkc.net> bl
> news:emIuHXzlEHA.2492@.TK2MSFTNGP15.phx.gbl g...
> that
> get
> my
> the
> Explorer?
> server)
> extract
> clear
> to
>
>
|||Agree with Dan. You can try attaching the online log and look for the
records in recycled area. It may still be there depending the db activities.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u$spsqzlEHA.2380@.TK2MSFTNGP14.phx.gbl...
> It looks like your database is in the SIMPLE recovery model and the log
was[vbcol=seagreen]
> truncated. Some of the data might still be in the log but there's no
> guarantee. I don't know of a way to find out without running the utility.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Thomas Tsang" <thomast@.hkc.net> wrote in message
> news:OUE$UbzlEHA.3428@.TK2MSFTNGP14.phx.gbl...
fn_dblog[vbcol=seagreen]
access[vbcol=seagreen]
the[vbcol=seagreen]
how
>

Wednesday, March 7, 2012

Recordset Modification and Copy

Please Help.

I have written a custom DTS task in an ActiveX Script. My script creates three recordsets from three existing tables in an SQL Server 2k DB by copying all the data in these tables.

My script then modifies the data in these recordsets including dropping several records, creates a new table and inserts the modified data into the new table.

Unfortunately, I need to keep my original data unmodified...and currently my code changes my original data when it modifies the record sets.

Does anyone have a method for modifying a recordset without modifying the source data? I am writing my ActiveX Script through the VB scripting language.

From what I have read on the internet some people suggest creating a new recordset, copying the data from the original recordset to the new recordset, and then modify and insert the new recordset. This is supposed to keep my source data unchanged. Unfortunately, I have not been successful with this method mainly because I am having trouble creating a new recordset and copying my original recordset data into this new object.

Thank you in advance for any help or input you might have!!!

-TRocheI assume you are using ADO? Disconnect your recordset by setting your ActiveConnection property to nothing.|||I don't think this will work. You see I have to manipulate the data through several DO Until loops. The constraint on my DO loop is

"DO UNTIL rs.EOF"

Before I set the recordset ActiveConnection to nothing It tells me I have to first close the recordset. Unfortunately, I can not run the syntax of the above loop if the recrordset is closed, and if I open the recordset with a new connection it again changes my source data.

Does anyone have any additional insight?

Thanks!

-TRoche|||create a function READ UNCOMMITTED transaction isolation level (you can do it with nolock optimizer hint) and do your DO UNTIL against the rs that points to it.|||Wow...I am just a beginner at this stuff...I will look into it, but do you have a sample code for this by chance?

thanks,

TRoche|||create function dbo.fn_select_star_from_your_table (
@.parm1 <data type>,
@.parm2 <data type>,
@.parm3 <data type> ) returns table
as return (
select * from your_table (nolock)
where field1 = @.parm1
and field2 = @.parm2
and @.field3 = parm3)
go|||Hmmmmm....ok to start I am writing a custom DTS Task, using an ActiveX Script in the DTS Designer, coding in VBScript

Well I am having a few problems with the previous comments. First off I can't get the code to drop the function ms_sql_dba advised. Here is my DROP code for a function called FUNSTUFF:

dim Dropx
set Dropx = CreateObject("ADODB.Command")

Dropx = "Drop Function [dbo].[FUNSTUFF]"
connection.execute Dropx

I am only trying to drop the function because if I run the code multiple times it errors saying the the object "FunStuff" already exists in the database...and I looked...and it does...dang Does anyone see something wrong with the above DROP code?

Also, ms_sql_dba, I am not sure I understand what your function does. Here is how I thought to use your advice.

Write a function called ADVICE as follows:
dim ADVICE
set ADVICE = CreateObject("ADODB.Command")

ADVICE = "CREATE FUNCTION dbo.FUNSTUFF (@.time float, @.Position float ) RETURNS Table AS RETURN (select * from GPSy (nolock) where ty = time and GPS_y = Position)"

then:
Open.recordset ADVICE, Connection, adOpenKeyset

Then write my do loop:
DO UNTIL recordset.EOF
blah, blah, blah
Loop

Unfortunately, I run into all kinds of errors like saying the operation can not be performed if the recordset is closed. But if I write an open command like:

open.recordset.connection

I get the error that the function FUNSTUFF alreadyexists in the database.

Hmmmmmmmm...

Does anyone have any advice? Do I have to write the Function code before every loop or a drop code after every loop...or...hmmm...I am just confused about how the function works.

A million thanks to anyone who has any input!!

-TRoche