Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS Performance

Status
Not open for further replies.

ssreddy

Programmer
Aug 13, 2001
4
HK
Hi,
I have a DTS Package in which I import data from ORACLE server into the SQL Server every night. The Problem is that everytime it tries to create a new table it gives an error because I saved my import procedure through the wizard. But can I do something so that this checks for the existence of the table first and if it exists then it skips the process of creating it and just copy the contents.
 
YES Try use a SQL Query Task and use something like this sample code:

if exists (select * from sysobjects where id = object_id(N'[dbo].[MyTableName]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Begin
YOUR SQL Statements Here to Copy Data
END
ELSE
Create Table Here
END AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top