error:將字符串轉換為 uniqueidentifier 時失敗


sql server查詢中出現 將字符串轉換為 uniqueidentifier 時失敗異常

原因為id設置為uniqueidentifier 字段,在where查詢時需要做轉換cast(id as varchar(36)),例如

select * from test where cast(id as varchar(36)) in('2946a572-7dbf-4ab8-a9d2-0374797eac7f','46bc350c-ff43-4b53-98f4-62b542f16ba8')

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM