![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Would anyone know how to check for the existence of a table before starting a transform task against it? I.e. if the table exists, go ahead and copy it, but if not, exit the package without an error message. thanks, -marty nicholson |
#3
| |||
| |||
|
|
IF OBJECT_ID('owner.YourTable') IS NULL -- Get out now -- Andrew J. Kelly SQL Server MVP "Martin Nicholson" <mgnicholsonNOSPAM (AT) hotmailNOSPAM (DOT) com> wrote in message news:O$rDFmLpDHA.1672 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Would anyone know how to check for the existence of a table before starting a transform task against it? I.e. if the table exists, go ahead and copy it, but if not, exit the package without an error message. thanks, -marty nicholson |
#4
| |||
| |||
|
|
Thanks for the reply. I understand the "IF OBJECT_ID" part, it's the "Get out now" part that I am struggling with. It looks like a transformation task wants a rowset returned, or at least a row count, or else it errors out with "invalid pointer". What I want to do is return nothing, but have no error. In my case, the table not existing is not considered an error. Is there some way thru SQL that I can return a DTS code such as DTSTransformStat_OK, or can it only be done in an activeX script? thanks again. -marty nicholson "Andrew J. Kelly" <sqlmvpnooospam (AT) shadhawk (DOT) com> wrote in message news:uTBHqBMpDHA.384 (AT) tk2msftngp13 (DOT) phx.gbl... IF OBJECT_ID('owner.YourTable') IS NULL -- Get out now -- Andrew J. Kelly SQL Server MVP "Martin Nicholson" <mgnicholsonNOSPAM (AT) hotmailNOSPAM (DOT) com> wrote in message news:O$rDFmLpDHA.1672 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Would anyone know how to check for the existence of a table before starting a transform task against it? I.e. if the table exists, go ahead and copy it, but if not, exit the package without an error message. thanks, -marty nicholson |
![]() |
| Thread Tools | |
| Display Modes | |
| |