我在任何地方完全沒有使用int的時候出現這個錯誤。當int沒有使用時,int與uniqueidentifier不兼容
我有這個存儲過程
ALTER procedure [dbo].[usp_GetFileGuid] @fileType varchar(25)
as
select [id] from fileTypes where dirId = @fileType
這裏ID是在文件類型表中的唯一標識符
當我執行以下
declare @fileGuid uniqueidentifier
exec @fileGuid = usp_GetFileGuid 'accounts'
print @fileGuid
我收到以下錯誤
(1 row(s) affected)
Msg 206, Level 16, State 2, Procedure usp_GetFileGuid, Line 0
Operand type clash: int is incompatible with uniqueidentifier
將存儲過程的輸出分配給局部變量的語法有什麼問題嗎?謝謝。
謝謝。我相信這對你來說只是一小塊蛋糕。我正在從編寫簡單的選擇語句過渡到編寫過程:) –