Author |
Topic |
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 14:34:46
|
Have a job that calls a DTS package, DTS is an Export & Import wizard to copy tables. Someone deleted a table from source and my job failed last night. Inputs appreaciated. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 15:04:33
|
You forgot the most important part of posting a question: the question!What is your question?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 16:20:36
|
how to prevent this?...they told me the tables should be drop at anytime. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 16:24:31
|
Modify the DTS package to check if it exists or modify the job to do the check. It's probably easier to just modify the job. Before the call to dtsrun add an IF statement that checks for the table(s). Only run the package if they exist.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 16:32:01
|
but there are 100 tables.....do i need to write 100 checks...oh my good... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 16:35:04
|
Are you just copying a database?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 16:37:06
|
yes But from 2005 to 2000 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 16:45:12
|
You're going to need to write a bunch of code. I think I'd find out what tables were there via INFORMATION_SCHEMA.TABLES and then bcp those out to files. Once the data is in the files, I'd have another process that looped through a folder and processed each found file. Perhaps you could name your files the same as the table names to make the import dynamic and easy.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 16:48:29
|
oh my good. |
|
|
funketekun
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-05-21 : 18:18:37
|
anyway to use bcp without using xp_cmdshell? xp_cmdshell is disable in the damn server. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 18:51:14
|
It's disabled by default in SQL Server 2005. Can't you just enable it?If you can't enable xp_cmdshell, then you'll need to do this from the command line through a batch file.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|