Friday, April 18, 2008

Convert unix time to normal time from while copying data from mysql data files to sql server 2005

Follow the steps mention in posting,


Sunday, March 23, 2008
Copy data from mysql data files to sql server 2005

Until “Again next and write sql query to get data. (table by table)

This step when you select data you can use “FROM_UNIXTIME and convert unix time to normal time.

For Eg:

Without considering the unix time here is the SQL script,

select`id`,`time`,`userid`,`ip`,`course`,`module`,`cmid`,`action`,`url`,`info`

from mdl_log_sem1

Considering the unix time here is the SQL script,

select `id`,FROM_UNIXTIME(`time`),`userid`,`ip`,`course`,`module`,`cmid` ,`action`,`url`,`info`

from mdl_log_sem1

Here simply use as FROM_UNIXTIME(`time`)

time- name of the field



then other steps are same as in the previous posting.

No comments: