Nov 29 2021 11:22 PM
Hi all,
I'm trying to export an SQL query for several tables into individual CSV files.
Im getting an error with the syntax with the colon in front of "OUT" and the backslash for the where I want to save the file to C:\....
_________
:OUT c:\XXXXXXX.csv
SELECT * FROM [XXXXXXX].[XXXXXX].XXXXX
GO
________
Is anyone able to tell me what I did wrong?
Nov 30 2021 10:22 PM
Looks like you try to run the query in a SSMS query window, right?
To run a SqlCmd script in SSMS you have to switch into SqlCmd mode first.
Menue "Query" => "SQLCMD-Mode"