SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating an import from sql server


Creating an import from sql server

Author
Message
saurabh_goel_86
saurabh_goel_86
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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
Kingston Dhasian
Kingston Dhasian
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3763 Visits: 5180
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/
saurabh_goel_86
saurabh_goel_86
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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?
Kingston Dhasian
Kingston Dhasian
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3763 Visits: 5180
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/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search