Where does Microsoft Dynamics CRM store OptionSet values in SQL Server?
I'm doing a data migration in to Microsoft Dynamics CRM 2011 and need to perform reconciliations against the source to ensure that everything loaded successfully.
To do this I am querying th开发者_JAVA技巧e SQL directly in SQL Server, but I can't seem to find where the OptionSet data is stored. Does anyone know what table(s) it's stored in?
These are all stored in the StringMapBase table. You'll query via object type code of the entity, attribute name, option set value and language and that'll give you the display value of the attribute.
Just a reminder! Use FilteredStringMap to continue to be 'supported' by Microsoft!
Here is an SQL Server function to query the stringmap
CREATE FUNCTION fn_new_GetStringMapValue
(
@AttributeName nvarchar(100),
@AttributeValue int
)
RETURNS nvarchar(4000)
AS
BEGIN
DECLARE @Result nvarchar(4000)
SELECT @Result = Value
FROM dbo.FilteredStringMap
WHERE AttributeName = @AttributeName AND AttributeValue = @AttributeValue
RETURN @Result
END
GO
精彩评论