Creating an import from sql server

  • Hi All,

    Below is the automation i need to do:

    There is a table which has entries coming to it every day. I need to check which all entries came on Monday.

    Then every consecutive day till Sunday i need to know which all "new entries came/entries got deleted" to this table and start the process all over over again from monday.

    Then i need to import these things.

    Would be great if someone can guide me through the steps.

    Thanks,

    Saurabh

  • There is a table which has entries coming to it every day. I need to check which all entries came on Monday.

    Create a table with a column to store date on which the entry was added. Use a date related data type like DATE, DATETIME OR SMALLDATETIME for this column.

    Using this column you can then find the exact date on which the entry was added and thereby the Weekday.

    Then every consecutive day till Sunday i need to know which all "new entries came/entries got deleted" to this table and start the process all over over again from monday.

    You can use the date column create above to find the new columns added.

    If you want to find the deleted entries, you can create a trigger on DELETE action which will store the deleted data in another table.

    Then i need to import these things.

    Where? If you need to import to some other table in SQL Server, you can write and INSERT statement for the new table and SELECT from the old table.

    I hope this helps..


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • HI,

    Thanks for the assistance..

    I need to import this and send it over to client.

    A .csv format or excel format which ever would be suitable..

    I was wondering which one would be better to automate this.. Writing a batch file or a vbs script?

  • saurabh_goel_86 (6/19/2013)


    HI,

    Thanks for the assistance..

    I need to import this and send it over to client.

    A .csv format or excel format which ever would be suitable..

    I was wondering which one would be better to automate this.. Writing a batch file or a vbs script?

    I am not sure about either batch file or the vbs script.

    But, you can do this using SSIS in SQL Server itself.


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

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

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