Timestamp conversion in SQL Server

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ra9
Participant
Posts: 1
Joined: Mon Aug 07, 2006 10:06 am

Timestamp conversion in SQL Server

Post by ra9 »

we are using Parallel, Windows, Sql server 2005

we are getting like this in Flat files
7/6/2004 5:00:00 AM
8/15/2005 4:59:00 AM
11/21/2005 4:22:22 AM

Target is sql server using datatype TIMESTAMP.
need to be converting into

2004-07-06 05:00:00.000
2005-08-15 04:59:00:000
2005-11-21 04:22:22:000

if any one have idea about this , please could let me know.
Thanks
ra9
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Did you try doing it normally? Did you face any errors while loading the data as it is? All you need to do is set the datatype to Timestamp with a scale of 3. Try doing that and see if it works. If it doesnt, then post the error message so that it will be easier for us to answer.
Kris

Where's the "Any" key?-Homer Simpson
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

ra9,
I was told by Ascential that 7.5X2 EE does not support SQL 2500.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

We do need some more information to answer this

Post by jdmiceli »

Hi,

I think 'lstsaur' is right that SQL Server 2005 is not directly supported yet, but the ODBC driver may work provided you have the most recent MDAC loaded (though this is speculation on my part).

If the other suggestion made ahead of my note here don't work for you, try using a user defined sequel that contains the key term 'COLLATE DATABASE_DEFAULT' for the date field after performing a CAST on the field name. Something similar to CAST(fieldname as varchar(20)). Bear in mind, I'm pulling this off the top of my head and I don't know if there needs to be any modification for 2005 or not. Hit the online books for the SQL side of it.

Overall, I agree with the others that we really need more information about your job to be able to truly help.

Bestest,
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Re: Timestamp conversion in SQL Server

Post by shilpa79 »

ra9 wrote:we are using Parallel, Windows, Sql server 2005

we are getting like this in Flat files
7/6/2004 5:00:00 AM
8/15/2005 4:59:00 AM
11/21/2005 4:22:22 AM

Target is sql server using datatype TIMESTAMP.
need to be converting into

2004-07-06 05:00:00.000
2005-08-15 04:59:00:000
2005-11-21 04:22:22:000

if any one have idea about this , please could let me know.
Thanks
ra9
In my case I have to insert date "8/15/2005 4:59:00 AM "from XML file
same into the Sql server 2005
Input sqltype varchar---------------> output Timestamp
Post Reply