You are here: Re: Trouble with Informix datatypes « MsSQL Server « IT news, forums, messages
Re: Trouble with Informix datatypes

Posted by Tony Rogerson on 11/02/06 16:25

The problem is that SQL Server datetime and smalldatetime will hold the day
and time which is not what you are after (I think).

If you just want to store year and month then you can use integer instead
and store it 200611 for instance; however, you won't be able to use date
functions on it like DATEDIFF etc... So, you need to way the pro's and con's
up; if you do store it in a datetime then you need set it to the first day
of the month and midnight - 200611 would become 20061101 00:00:00.000 for
datetime.

HTH

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials


"Rodolfo" <lottofire@gmail.com> wrote in message
news:1162339133.464417.218150@i42g2000cwa.googlegroups.com...
> Hi everybody!
>
> I'm working on a migration from Informix to SQL Server... I'm doing it
> through DTS and ODBC.
>
>
> What I'm doing is using the DTS, my data origin is tha Informix
> database and mi target is the SQL Server database that I just created,
> this is via IBM Informix ODBC and I copy the tables... but the results
> are something like this:
>
>
> --INFORMIX--
>
>
> create table r_cap_dbt_uni
> (
> num_db smallint ,
> cve_uni char (8) ,
> fecha_mens datetime YEAR to MONTH ,
> valor float ,
> primary key ( num_db, cve_uni, fecha_mens ) ,
> foreign key ( num_db )
> references cat_db_tec ( num_db )
> );
>
>
> -- SQL SERVER --
>
>
> create table r_cap_dbt_uni
> (
> num_db smallint ,
> cve_uni char (8) ,
> ***********************************************
> fecha_mens smalldatetime ,
> valor float ,
> ***********************************************
> primary key ( num_db, cve_uni, fecha_mens ) ,
> foreign key ( num_db )
> references cat_db_tec ( num_db )
> );
>
>
> as you can see the float and datetime year to month data types change
> like the example before.... I changed the "float" datatype manually to
> "decimal" datatype... but I don't know what to do with the "datetime
> year to month" Informix datatype, I mean, I dn't know why the DTS
> changes this datatype to "smalldatetime"... how can I map this? what's
> the process?
>
>
> Thank you very much!
>
>
> Rodolfo
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация