3

I have the following expression in ssis

(ISNULL [rowguid]? (DT_WSTR, 255)"00000000-0000-0000-0000-000000000000":[rowguid])

What I want is to assign that guid if there is null present. I just can't seem to get it working

abs786123
  • 581
  • 2
  • 11
  • 24
  • I have the exact same problem. In TSQL you can insert a varchar that looks like a GUID into a UniqueIdentifier column but in SSIS it fails. – BilliD Mar 09 '17 at 16:32
  • (DT_STR,50,1252) (ISNULL( [apuk_networkid]) ? "00000000-0000-0000-0000-000000000000" : (DT_STR,50,1252) [apuk_networkid]) != (DT_STR,50,1252) (ISNULL( [LK_apuk_networkid]) ? "00000000-0000-0000-0000-000000000000" : (DT_STR,50,1252) [LK_apuk_networkid]) – abs786123 Jul 12 '17 at 09:31

2 Answers2

4

FInally got the answer via trail and error

  (DT_STR,50,1252) (ISNULL( [rowguid]) ? "00000000-0000-0000-0000-000000000000" : (DT_STR,50,1252) [rowguid]) != (DT_STR,50,1252) (ISNULL( [rowguid]) ? "00000000-0000-0000-0000-000000000000" : (DT_STR,50,1252) [rowguid])
abs786123
  • 581
  • 2
  • 11
  • 24
3

I finally figured this one out. You need to include "{" and "}" on the front and end of your default GUID. So for example, (DT_GUID) "{00000000-0000-0000-0000-000000000000}".

A little frustrating, I tried "[]" but never even thought to try "{}".

BilliD
  • 577
  • 2
  • 7
  • 17