2012年3月8日星期四
Disaster Recovery
'Transfer Dependent Object' checked and the 'Drop Destination Objects'
result I have over-written certain tables
Can it be undone with the
transaction log and if so How ?
regards EarnieIf you have a backup of your target database, prior to the overwrite,
restore it. Or restore it with a different name, and copy the objects you
need.
In case of no backup, you can use a tool like Lumigent Log Explorer to undo
those changes.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Earnie" <Earnie@.discussions.microsoft.com> wrote in message
news:EADFAF0B-FD14-4937-9F6D-98DFAE297CFF@.microsoft.com...
Whilst importing some procedures, I have left the
'Transfer Dependent Object' checked and the 'Drop Destination Objects'
result I have over-written certain tables
Can it be undone with the
transaction log and if so How ?
regards Earnie|||Assuming you have valid database and log backups, use the STOPAT option
to restore the log to a point in time before the tables were droppped.
David Portas
SQL Server MVP
--
2012年2月25日星期六
Disabling the flat file destination at run-time?
I noticed that The flat file destination that I am using, creates a blank file everytime even if there are no records processed by the data flow.
I just wanted to know if there is any way to stop this. I dont want to see a chunk of blank files on the disk. (I create the files with a timestamp in the file name so every run creates a new file.)
So I want to implement a logic to stop the creation of these blank files in case there are no records to write into it.
Any suggestion would be of great help.
Regards
Saurabh
One option is to use an Execute SQL in the control flow before the data flow to check the record count, and use a condition on a precedence constraint to the data flow to prevent it from running at all.
Another option is to use a Row Count component in the data flow to capture the number of rows written to the flat file. Set a File System task to delete the file after the data flow, with a precedence constraint that uses the row count to determine whether the File System task should execute.
|||well the first option is not suitable for me because I cannot determine the number of records to be written beforehand.
second option looks good. I'll do that but again that will be having to do one extra task. if at all there is any way to stop the file creation then that will be great. (I am playing around with a script component with no luck)
Thanks for your response John!
Please get back if you find out any other way...
|||
jwelch wrote:
One option is to use an Execute SQL in the control flow before the data flow to check the record count, and use a condition on a precedence constraint to the data flow to prevent it from running at all.
Another option is to use a Row Count component in the data flow to capture the number of rows written to the flat file. Set a File System task to delete the file after the data flow, with a precedence constraint that uses the row count to determine whether the File System task should execute.
Or to adapt a theme, push the data into a raw file or recordset (http://blogs.conchango.com/jamiethomson/archive/2006/06/28/SSIS_3A00_-Comparing-performance-of-a-raw-file-against-a-recordset-destination.aspx) and then use a conditional precedence constraint (as suggested by John) to decide whether to push the data into your flat file or not.
Plenty of ways anyway.
-Jamie
|||Sounds good! though me too didn't like to push the intermediate data to the disk, the performance analysis shown by Jamie is really helpful in making a decision.
Thanks for the response. I shall go with this solution insead of adding more complications to my short and sweet package!
Regards
Saurabh
Disabling Referential integrity database-wide on import
Is there a way to disable referential integrity on all destination tables for an import?
Thanks.
No, you have to disable all the related constraints. You can do this by:
1. In Enterprise Manager, see 'Disabling a Foreign Key Constraint with INSERT and UPDATE Statements' topic in SQL2000 Books Online
2. In Query Analyzer, use 'ALTER TABLE' command as:
ALTER TABLEMytableNOCHECK CONSTRAINTFK_MyFKCnt