SQL Query to Write/Create a File