Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Creating an import from sql server Expand / Collapse
Author
Message
Posted Wednesday, June 19, 2013 3:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 8:30 AM
Points: 2, Visits: 3
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

Post #1465023
Posted Wednesday, June 19, 2013 3:49 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 9, 2014 7:34 AM
Points: 2,666, Visits: 4,736
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/
Post #1465029
Posted Wednesday, June 19, 2013 3:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 8:30 AM
Points: 2, Visits: 3
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?


Post #1465033
Posted Wednesday, June 19, 2013 3:58 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 9, 2014 7:34 AM
Points: 2,666, Visits: 4,736
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/
Post #1465036
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse