user1166981 user1166981 - 7 months ago 39
SQL Question

Is there an equivalent in SQL as microtime() for PHP?

I assumed there would be a query you can make in SQL for this, microtime() is derived from the server environment so I hoped there would be a 'like-for-like' in SQL, but I can't see it. Im using MSSQL but would be interested in other dbs too.


Assuming MySQL, can you try something like this:


Here is the SQL Fiddle which also shows the use of MySQLs MicroSecond method.


Since you're using SQL Server, can this work:


And the SQL Fiddle.