title: How to set default datetime format in sql stored procedure
body: <p>I want to fetch data from table by changing date format to yyyy-MM-dd HH:mm:ss but in output it is dd-MM-yyyy HH:mm:ss by default.</p>
  
  <p>I can achieve this by using CONVERT function but this is to be applied once for one column but i have many column and tables so I don't want to write this for every column.
  I want to set the datetime format as default so even for simple select * query it will be showing formatted date.</p>
  
  <pre><code>CREATE TABLE dateFormatss (dateFormatOption int, dateOutput datetime)
  
  insert into dateFormatss (dateFormatOption, dateOutput) values ('1', '2019-12-31 14:47:48')
  
   select 
     [dateFormatOption],
     CONVERT(VARCHAR,[dateOutput],120) as dateOutput  from dateFormatss 
  
  SET DATEFORMAT ymd;
  
  select * from dateFormatss
  </code></pre>
  
  <p>OutPut:</p>
  
  <pre><code>dateFormatOption        dateOutput
      1               2019-12-31 14:47:48
  
  dateFormatOption        dateOutput
      1               31.12.2019 14:47:48
  </code></pre>