[ale] SQL differences

James Sumners james.sumners at gmail.com
Thu Oct 7 12:41:41 EDT 2010


You are asking for pain.

For now, the MSSQL "timestamp" is totally useless. Even Microsoft says
so[1]. So that's right out. What you will need to do is use a regular
DATETIME column and the methods outlined in [2]. Basically, create a
stored procedure/function in your MSSQL schema and use that to do your
timestamp conversions.

[1] -- http://msdn.microsoft.com/en-us/library/aa260631(SQL.80).aspx
[2] -- http://mysql.databases.aspfaq.com/how-do-i-convert-a-sql-server-datetime-value-to-a-unix-timestamp.html

On Thu, Oct 7, 2010 at 11:20 AM, Chris Fowler
<cfowler at outpostsentinel.com> wrote:
> On Thu, 2010-10-07 at 11:03 -0400, James Sumners wrote:
>> Agreed. Thanks for finding and posting this.
>>
>> Let me tell you, it is frustrating working with Oracle and MSSQL after
>> having used MySQL for so long. So many easy things in MySQL (e.g. the
>> LIMIT clause and the TIMESTAMP and AUTO INCREMENT column types) are
>> completely missing in the other two that I now have to use. I can see
>> this page being use very frequently by me.
>
>
> The project I'm working on will be to insert data in SQL Server after it
> is inserted in MySQL.  Basically I'm added data to another system for
> tracking.
>
> In MySQL I can do UNIX_TIMESTAMP(column) and get the epoch value.  is
> there a FROM_UNIXTIME() equivalent in SQL Server so that when I insert
> these times I don't have to do conversion from one format to another?
>
> Chris


-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59



More information about the Ale mailing list