how to export data from sql query?
Export SQL Server data to CSV by using SQL Server export wizard. One way to export SQL Server data to CSV is by using the SQL Server Import and Export Wizard. Go to SQL Server Management Studio (SSMS) and connect to an SQL instance.