Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sql expression - possible syntax error

Author  Topic 

android.sm
Starting Member

36 Posts

Posted - 2011-07-12 : 05:32:35
the following are sql expressions in ssis data flow. this particular task fails to insert / update country

derived column name: CountryGUID

ISNULL(@[User::UnknownCountry]) ? NULL(DT_GUID) : (DT_GUID)@ [User::UnknownCountry]

derived column name: CountryName:

ISNULL(@[User::UnknownCountry]) ? NULL(DT_GUID) : (DT_WSTR, 7) : "Unknown"

anyone see any possible syntax error(s)?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-07-12 : 05:38:59
Why NULL(DT_GUID) for CountryName? Shouldn't it be NULL(DT_WSTR) ?


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

android.sm
Starting Member

36 Posts

Posted - 2011-07-12 : 07:13:57
Thanks for spotting that - my error.

I'm using the logic in an ssis task and currently getting this error:

I have another error with it trying to attempt to convert from data type DT_WSTR to data type DT_GUID.

Not sure why...

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-07-12 : 08:30:49
DT_GUID is a binary format of 128 bits. You cannot convert much into that.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

android.sm
Starting Member

36 Posts

Posted - 2011-07-12 : 11:15:34
Do you suggest anything...a way to get DT_GUID? Or a different expression?
Go to Top of Page
   

- Advertisement -