Showing posts with label Trick. Show all posts
Showing posts with label Trick. Show all posts

Tuesday, October 13, 2009

Importing and exporting in Informatica Powercenter

When you work with Informatica Powercenter you probably have a development and production repository. This means you will have to transfer workflows form one repository to the other. You can use the copy function, but that doesn't work very well.


Instead you can use the import and export function. This works pretty good, but be sure to use the import and export function in the repository manager. The XML created by the repository manager is far more extended then the one in the workflowmanager.


But its not all milk and cookies.I often noticed that after importing my connections where gone. Second, the folders for the sources in the development repository are different then the folders in the production repository (i.e. for management reasons). I my case, we had less folders in the production repository so we had to fit some sources to different folders. This was a bit tricky.


I used the following trick to speedup the process:

  • Edit the XML using a good editor.
  • Find the connectionstring and alter it to the correct production stringname.
  • Find the foldernames and alter those to the correct production foldername.
  • Safe the XML and start your import again.


i.e.

Bronnen" DESCRIPTION ="" NAME ="Products" OBJECTVERSION ="1" OWNERNAME ="rd" VERSIONNUMBER ="1">

Bronnen" description="" name="Products" objectversion="1" ownername="rd" versionnumber="1">


Sunday, October 11, 2009

SQL: Getting just the datepart from a datetime

A nice little trick:

If you have a datetime field which has a date and a time in it, and you ony need the time, you can use the following code to cast it to a date only value:

select cast(floor(cast(getdate() as float)) as datetime)

First the code casts the datetime into a float. Then it rounds off the float leaving just the date. Then it casts the float back to datetime.

This trick is useful for SQL 2005. SQL 2008 has a function for this issue.