Move and Remove records

  • I am having a tough time with the concept of a temp table. I have a syslog daemon dumping into a SQL table, but I need to break out one of the fields into 13 different fields. I have created a DTS package that will delimit the field and transfer the records into the proper table, but I need to figure out how to then delete the original record in the temp table. I can not delete the temp table itself as the daemon continues to write into it. How do I do this, move and remove?

  • It sounds like you are using a real table not a temp table. How was this temp table created? You should be able to perform a normal delete with a where clause on this temp table as long as it's using the same connection as the one that created it.

    Example:

    delete from #TempTable where Field1 = 123

    Darren


    Darren

  • It is a real table. The table was created by the syslog daemon (Kiwi Syslog). When the table is created it takes the syslog information and places it all in one field. For reporting purposes I CAN take that data and break it all out using a query, but I would rather have the data parsed into the appropriate fields from inside the database, placed into the break-out table, and the raw data removed so it won't be reporcessed the next time the package runs.

    The really complicated part is that there is not a unique identifier field.

    How would I script the deletion at the same time as the selection?

    BTW, I'm still a newbie, I can work with VB, but I haven't quite grasped SQL scripts (other than the basic "Select" and the like).

  • If the contents of the single field is unique (eg contains date and time) then I would use a third table to hold extracted data, parse from, and join to the Real table to delete.

    You will have arrange for some sort of recovery in case part of the job fails.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 4 posts - 1 through 4 (of 4 total)

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