![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am runnng into a situtation with a vendor who does not load their database consistently. Sometimes a table is missing from their db. It is a lookup table so is not critical. What I want to do is check for the existence of the table in the source db, before I drop my local table. My package fails because this table is not present. I have tried checking it a few different ways, however how can I check for soemthing that does not exist, without my package failing? |
#3
| |||
| |||
|
|
Carolus: If I understand your problem correctly this should work. Assumption: Source and Destination are SQL Servers Setup a SQL Task targeting your source: SELECT ISNULL(OBJECTPROPERTY(Object_ID('dbo.theVendorTabl e'), 'IsUserTable') ,0) as TableExists Then configure the result as an Output Parameter and store it in a Global Variable Then when you are going to Drop the table do a SQL Task targeting your destination, configure the task to take the GV as an input parameter IF (? =1) BEGIN DROP TABLE localtable END -- David Lundell Principal Consultant and Trainer www.MutuallyBeneficial.com David (AT) MutuallyBeneficial (DOT) com "carolus.holman" <carolusholman (AT) discussions (DOT) microsoft.com> wrote in message news:45A67804-42FE-4C42-8544-0DA12A6AF317 (AT) microsoft (DOT) com... I am runnng into a situtation with a vendor who does not load their database consistently. Sometimes a table is missing from their db. It is a lookup table so is not critical. What I want to do is check for the existence of the table in the source db, before I drop my local table. My package fails because this table is not present. I have tried checking it a few different ways, however how can I check for soemthing that does not exist, without my package failing? |
![]() |
| Thread Tools | |
| Display Modes | |
| |