开发者

How to replace a string value with db null?

开发者 https://www.devze.com 2023-01-11 08:33 出处:网络
I have an ssis package that imports a view from one database into different db and places the data into a table.The view has all datatypes set to varchar which I cannot change.Some of these varchars a

I have an ssis package that imports a view from one database into different db and places the data into a table. The view has all datatypes set to varchar which I cannot change. Some of these varchars are really datetime values. The view has set all NULL values to N/A and i want to replace the N/A with db null. The table I am importing the data into has the date columns set to datetime rather than varchar and I cannot insert N/A into it. This is my first 开发者_Go百科ssis package and I'm having some issues with getting an expression setup to accomplish this. What would the string replace expression look like to make this happen? Thanks.


I was going about this the wrong way. The soultion is just to use as sql query to update the data rather than an expression.


I haven't tested but would something like this work in a derived column?

REPLACE("N/A", [yourfieldname] , NULL(DT_WSTR, 30) )

(adjust the string length to the current stringlength)

0

精彩评论

暂无评论...
验证码 换一张
取 消