SQL- How to write or create the data into a file or data sql to excel file
SQL- How to write or create the data into a file or data sql to excel file:
Much time we need to import over data in to file, in txt
file or excel file. Today we explain it.
In this tutorial blog we also consider
There are a lots of ETL tools available to fetch the data
from your database into the file. But these ETL tools are not possible for each
one and sometimes, we need to create a file to store the data from our database
in SQL.
create the data into a file or data sql to excel file:
In this section, we will learn that how can we write the
data into a file (Text or CSV) with the help of SQL.
Note: 'Ole Automation
Procedures' component should be turned on as part of the security configuration
for your server and a system administrator can enable the use of 'Ole Automation
Procedures' by using sp_configure.
If these components are turned off then you can use the
following command in your SQL Server Management Studio:
sp_configure 'Ole Automation Procedures', 1
GO
RECONFIGURE;
GO
sp_configure 'show advanced options', 1
GO
RECONFIGURE;
After the above command you will get the following message
in SQL-
Configuration option 'Ole Automation Procedures' changed
from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'show advanced options' changed from 1
to 1. Run the RECONFIGURE statement to install.