Click here to Skip to main content
Sign Up to vote bad
good
See more: C#SQL.NETExcel
Hello, dear SQL and programming gurus!
I have got one problem, and I think you cand help me. There is computer with SQL Server and a SQL DB. There are some tests running in our lab and during the test data through some hardware is stored in a SQL DataBase. The problem is that we can get the data by using some tools of Excel, but it is not so good, because we need data each 30-45 seconds, is there any tool, which can automatically import data to excel from sql? Or is there any other possibility to do this?
Please help me to do this.
Posted 17 Jul '12 - 1:20


4 solutions

You can refer the below link It will be useful for you,
http://www.likeoffice.com/28057/Excel-2007-Importing-data[^]
 
If you want your custom tool you can write it using a simple windows form(.net).
 
Smile | :)
  Permalink  
Comments
jamshedhkl - 17 Jul '12 - 7:33
Thank you for your reply, but I know this type of importing, you must do it manually, but I want something automatically. Unfortunately I don't know .NET, for this I wrote for help...
Hi,
 
You can do so by developing Windows Service or Some costume application.
 
but if you want a good solution then :
 
just write those query's which result you need sequentially
 
then save it in a SQL file
 
sqlcmd -S CAFRFD1LITPMA02 -i SQL FileName -o OutPutFileName [CSV | TXT ] -s
 
run this code in a Schedule, if you need individual files One by one then just change output file name Uniquely.
 
For that just add Date Time with file name using Commend Prompt
 
you can save this hole as Batch file and run it under Scheduler.
 
Commend Prompt Details Click Here[^]
Or Here[^]
 
For More Help Reffer : http://social.msdn.microsoft.com/Forums/en/transactsql/thread/b3f406e1-1b2e-4ee4-8d28-4470c0ea19f9[^]
  Permalink  
What you can do is , create a stored proc and inside that write logic to export data to excel using openrowset. you can find some solutions about this in this link.
 
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926[^]
 
You can schedule a job for this sql proc and run periodically at the time interval you want.
 
hope this would give you an idea to take forward.
  Permalink  
Sirs, I don't know anything about programming( Please if it is posssible can you say me conctrete steps...
I also found this one Database to Excel Spreadsheet[^] but I cannot use it I dont know how. The folder where my DB stored is C:\Dokumente und Einstellungen\gast731\Eigene Dateien\Eigene Datenquellen\WS0451_SQLEXPRESS master STUEP_ZYLINDER_TREND.odc how can I do it?
  Permalink  
Comments
Suvabrata Roy - 17 Jul '12 - 8:53
Hi, Do you know how to Write SQL Query ? Other wise above solutions is not useful for you and if you know then you can use the above solution as well as mine... :)
jamshedhkl - 17 Jul '12 - 14:37
No I don't know that one, but there is an executable application, how can I use that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 325
1 Abhinav S 168
2 Sergey Alexandrovich Kryukov 150
3 Ron Beyer 100
4 Zoltán Zörgő 85
0 Sergey Alexandrovich Kryukov 8,386
1 OriginalGriff 6,596
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 21 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid