Automatically Export Data from SQL Database to CSV Excel File and Delete Table Automatically
Вставка
- Опубліковано 11 лют 2025
- Code for Exporting Data:
SQLCMD -S DESKTOP-76IUJ1R -d TestDatabase -E -Q "select * from [tblDatabase] ORDER BY DatabaseCPU_Load" -s "," -o "C:\Users\Charlie\Documents\SQL Data\Database_Data%date:~10,4%%date:~4,2%%date:~7,2%.csv"
Code for Deleting Data
SQLCMD -S DESKTOP-76IUJ1R -d TestDatabase -E -Q "DELETE FROM [tblDatabase]"
Very nice and very useful video. absolutely handy for every day tasks. Can you make a video on how to schedule the same task using SQL agent. Consider a scenario you have 30 data sets to be created. This means, you will need 30 SQL jobs to run each of these batch files, in case any of the jobs aren't working, easy to figure out the error and trouble shoot. Ideally, I am thinking to implement this for data visualization project in Qlik View, where these files (.csv) files will be imported as data sources into Qlik View and then that will be scheduled to get the real time (on an hourly basis).
very clear and straightforward although mine is not generating the file
you are no.1 thank you nice video training
Thank you! How can I do it to execute it with another user that I login to the SQL server using SQL server credentials?
I have a question, I compiled but I only see the black window for a few seconds and then nothing, the Excel was not created. Help please
Hi Charlie. Good evening. I am in these field of coding… Can you please help me in converting my Safari History.db to .csv, 'where the links can be ordered by the date accessed' ?
Thanks in advance.
it gives me this error: " Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed for user " what should i do?
Thank y my Professor ❤❤❤
Any time
Hi how to export data from sql stored procedure to Excel with same steps that u have used in the video please help me
Actually im try to export data with 3 tables by joining them and some where conditions … im having issue so i wanted to convert to stored procedure and wanted to pull as per above ask
Ur name Schuld be professor thanks you very much