Append data in a existing table

  • Hi All

    I am transfering data with ODBC link from a MySQL view to sql. When table is update on Mysql server i got confirmation noteped file through FTP server that updation is complete now i want to append data to my existing table.

    Drop Table [dbo].[Jshipment_lines]

    Go

    CREATE TABLE [dbo].[Jshipment_lines] (

    [cono] char (2) NULL,

    [customer] varchar (9) NOT NULL,

    [period] int NOT NULL,

    [item] varchar (30) NOT NULL,

    [qty] smallint NOT NULL,

    [value] real NOT NULL,

    [invdate] char (10) NULL,

    )

    But now i don't want to delete table i just want to append data after getting confirmation notepad file.

    This code is written in Execute sql task.

    Thanks In advance

  • I don't quite follow - you obviously have more code in your job which would be an insert into your newly created table.  Just modify the script to not drop the table and not create the table...

    You don't have a primary key in the table - I assume this is because if it is a log file (with no date) then two lines could be identical.  In that case add a column called LogTimestamp of type dateTime and set it as your primary key - this assumes that you don't have two entries occurring within 3ms of each other.  If so, add an identity col and use it as the pkey instead....

     

  • Hi Ian

    No i don't have any primary key in this table because every colum has duplicate value. This is a view which is not on my system i am only importing this view from other server. This view gives me daily data and i need to collect that data in one table. Is there any other way without using DTS?

     

     

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply