I had write a procedure that export each of the SQL Query data to the csv file with header. But I dont know the error shown as below.
Msg 512, Level 16, State