Hi,
I'm moving some data from AS400 DB2 to SQL Server and run
into date conversion problems.
My date from DB2 is numeric 8 characters eg "20031231".
How can I convert it to either datetime or smalldatetime
format in SQL server ?
If my table in SQL is defined as datetime/smalldatetime or
numeric, I will get error during the data pump process.
If I define in char format, data pump works fine but data
isn't the format I want ?
Can someone help ? Thanks.If the date is part of the PK for a fact or dim table, I would use an intege
r key and not datetime. INT or DECIMAL(9,0) should be sufficient for your ne
eds if that is the case. I sometimes import .txt files from AS/400 and the s
ource table must not allow
packed signs. In the activex script transforming the data from source to des
tination you could convert int to datetime or char to int to datetime if you
wish.
You might want to consider importing textfiles and not use the source table
directly since this option gives you a snapshot of the data. If the import f
ails you will always have a source file to check for errors. A transactional
source table might change
and the error be corrected without your knowledge.
Showing posts with label dbs. Show all posts
Showing posts with label dbs. Show all posts
Sunday, February 12, 2012
Convert Dbs from SQL Server 2005 to 2000
I need to convert my SQL Server 2005 databases (and Stored procs) to ones
that will run SQL 2000. How do I do this?
If you haven't used any of the new 2005 features or datatypes you should be
able to script out the schema and run it against the 2000 box. If you have
data to migrate you can bcp it although you may need to use one of the
character formats.
Andrew J. Kelly SQL MVP
"FredC" <FredC@.discussions.microsoft.com> wrote in message
news:3E3ADB6F-9100-4AAC-AB09-09B1BB4F9CDF@.microsoft.com...
>I need to convert my SQL Server 2005 databases (and Stored procs) to ones
> that will run SQL 2000. How do I do this?
that will run SQL 2000. How do I do this?
If you haven't used any of the new 2005 features or datatypes you should be
able to script out the schema and run it against the 2000 box. If you have
data to migrate you can bcp it although you may need to use one of the
character formats.
Andrew J. Kelly SQL MVP
"FredC" <FredC@.discussions.microsoft.com> wrote in message
news:3E3ADB6F-9100-4AAC-AB09-09B1BB4F9CDF@.microsoft.com...
>I need to convert my SQL Server 2005 databases (and Stored procs) to ones
> that will run SQL 2000. How do I do this?
Subscribe to:
Posts (Atom)