Several hiccups can happen when trying to INSERT or UPDATE a record with the current date and time. For one, regional settings and/or SQL Server's dateformat setting can throw you for a loop (see
Article #2260 for some workarounds to regional settings issues), and even delimiters can get in the way when moving between platforms (see
Article #2023).
My suggestion: let the database put the date and time on the record. In SQL Server, you can do this:
CREATE TABLE blah ( foo VARCHAR(5), bar DATETIME NOT NULL DEFAULT GETDATE() ) |
(And for UPDATEs, you could create a trigger.)
This way, you don't have to worry about your application code getting the date format correct (since SQL Server will automatically generate the current time for you, and store it in its own internal format), and you can have one less column in your INSERT list.