I'm new in sql server
and want to save select query into the csv file using with bcp query out for that purpose write this query:
declare @cmd as nchar(50)
SET @cmd = 'bcp select *from [behzad].[dbo].[behzad] queryout "d:\spt_values.dat" -U behbeh -P beh1368421 '
EXEC master..XP_CMDSHELL @cmd