SELECT ‘ActionSite’ AS ‘Sitename’, P.ID, ‘Category’ AS ‘PropertyName’,
dbo.fn_ExtractField(‘Category’, 0, P.Fields) AS ‘PropertyValue’
FROM dbo.VERSIONS AS V INNER JOIN
dbo.LOCAL_OBJECT_DEFS AS P ON V.ID = P.ID AND V.LatestVersion = P.Version
WHERE (V.Sitename = ‘ActionSite’) AND (NOT (P.ParentID = 1)) AND (dbo.fn_ExtractField(‘Fixlet Type’, 0, P.Fields) = ‘Task’) AND (dbo.fn_ExtractField(‘Category’, 0, P.Fields) IS NOT NULL)
the result is :
ActionSite 235 Category 绋嬪簭绠$悊
ActionSite 250 Category 绋嬪簭绠$悊
ps: The ‘Category’ is a string of Chinese. if i use the dbo.fn_ExtractField(),i will get a unrecognizable code. How can i get the correct value? Who can help me?
Can you post the results from this query for one of the tasks that returns Chinese Characters?
select top 1 p.id, p.name, convert( xml, convert( varbinary(max), p.fields ) ) as ConvertedXML
from local_object_defs p
join versions v on v.id=p.id and v.sitename='ActionSite' and p.version=v.latestversion
where
p.parentid=0
and dbo.fn_ExtractField('Fixlet Type', 0, P.Fields) = 'Task'
order by name
You might need to add a where clause for p.id=235 to get a task that is broken.
I’m curious if the Chinese Characters are stored in the database like that, of if something else is causing it to get returned and displayed incorrectly.