To export SQL query data to a comma separated value (CSV) file we can use Bulk Copy Program (bcp) utility. Follow below steps to get the desired CSV file.
- Enable xp_cmdshell property to use the bcp utility
- Write the desired query and passed it in the xp_cmdshell command
3. Output CSV
No comments:
Post a Comment