Thursday, April 7, 2016

Encoding format of flatfile in SSIS

when you are using SSIS to load flatfiles , make sure you know the encoding format as it may cause very weird progme.

 

The flat file connection manager uses Unicode as the default and if the flatfile encoding format is not unicode, it can not be loaded.

Sometimes, it is really hard to tell why two .csv file, one can be loaded but the other fails all the time.

 

How to check the encoding format?

In VS, open the flat file and try to save it with Encoding, the encoding format info will show up there.

 

Happy debugging…

Friday, April 1, 2016

test post

hello world

find out which process is blocking

a few days ago, I was working on a very simple ETL task . What I did is delete a table
and reinsert. However, odd things happen after deletion as it takes forever to count the number
in this table... very odd

After while, I figured it out by using the script below to find out which process is blocking the table
and kill the process. After that,everything is back to normal

-- find out which process is blocking
select distinct object_name(a.rsc_objid), a.req_spid, b.loginame
from master.dbo.syslockinfo a (nolock) join
master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid
where object_name(a.rsc_objid) is not null