SQL Server报错:字符串转uniqueidentifier失败,语义搜索属性列表配置求助
Hey there! Let's get that semantic search setup working smoothly for you. The error you're hitting comes down to an invalid GUID format in your PROPERTY_SET_GUID value—SQL Server is strict about uniqueidentifier strings following the standard 8-4-4-4-12 hex character structure, and your current string is missing a critical segment.
What's Off in Your Original Code?
The GUID you used ('F29F85E0-1068-AB91-08002B27B309') is missing the 4FF9 segment that's required for the System.Title property's property set. This missing part breaks the uniqueidentifier format, triggering the conversion error.
Corrected Working Code
Swap out your existing ALTER statement with this valid version:
ALTER SEARCH PROPERTY LIST DocumentPropertiesTest ADD 'Title' WITH ( PROPERTY_SET_GUID = 'F29F85E0-4FF9-1068-AB91-08002B27B3D9', PROPERTY_INT_ID = 2, PROPERTY_DESCRIPTION = 'System.Title = Title of the item' ); GO
Quick Tip for Future GUID Checks
If you ever run into similar issues, you can verify a GUID's validity with this simple test query:
SELECT CAST('F29F85E0-4FF9-1068-AB91-08002B27B3D9' AS UNIQUEIDENTIFIER)
If it returns a value without errors, you know the GUID is formatted correctly for SQL Server.
内容的提问来源于stack exchange,提问作者user7245782

