Using the GETDATE () in the SQL Server date function to get the current date, you will be presented with a method that uses the SQL Server date function to get the present date.
But what if we just need to get the current date, don't need a part of the time, or don't need a date as long as the time part, or I want the date in the field to show in some way, how should I do?
You can use the methods such as convert (varchar), GETDATE (), 120), where varchar (10) Defines the length of the field you want, and of course the length of the difference will not return, if we just date part, set to 10 exactly for the date length , if set to 19, you can read the time section exactly.
Now we introduce the parameters of the last generation, respectively, using the parameters of generation and the effect of example:
SQL Server CONVERT () function: http://www.w3school.com.cn/sql/func_convert.asp
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/