I am trying to work 'Choices', formerly known as OptionSets in Azure Dataverse.
I am trying to implement the sample code from the link https://learn.microsoft.com/en-us/power-apps/maker/data-platform/azure-synapse-link-choice-labels
The code is as follows:
SELECT LocalizedLabel as statecode
FROM databasename.dbo.account_partitioned
LEFT JOIN databasename.dbo.OptionsetMetadata
ON (databasename.dbo.OptionsetMetadata.Option = databasename.dbo.account_partitioned.statecode AND databasename.dbo.OptionsetMetadata.OptionSetName = statecode)
After executing the code, I get the following error
Incorrect syntax near the keyword 'Option'.
Any thoughts on what might be causing the error?
I also just the same code, with the square brackets, as follows:
SELECT [LocalizedLabel] as [statecode]
FROM [databasename].[dbo].[account_partitioned]
LEFT JOIN [databasename].[dbo].[OptionsetMetadata]
ON ([databasename].[dbo].[OptionsetMetadata].[Option] = [databasename].[dbo].[account_partitioned].[statecode] AND [databasename].[dbo].[OptionsetMetadata].[OptionSetName] = statecode)
But I got the error:
Incorrect syntax near ']'.