The MySQL now() function in MSSQL

Posted by on December 12, 2012 in MSSQL | 0 comments

If I want to insert the current time into a field when doing an insert in MySQL I usually use the NOW() function. It’s built right into the query string and makes sure you get the time of insert. In MSSQL though you have to change things to getDate(). If you have a date field, it will adapt to your type, but you can also specify a format of the date as the parameter.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment

Your email address will not be published. Required fields are marked *