我很困惑为什么这会返回结果:
EXEC GTKT_SP_Attachments @Operation = N'GetAllPhotoIDs', @TicketID = 1
但这不会:
DECLARE @Operation AS nvarchar(29) = N'GetAllPhotoIDs',
@TicketID AS int = 1
EXEC GTKT_SP_Attachments @Operation, @TicketID
有任何想法吗?
更新:EXEC GTKT_SP_Attachments @TicketID,@Operation 不起作用,因为 Operation 和 TicketID 之间有更多参数(错误:将数据类型 nvarchar 转换为 int 时出错);GTKT_SP_Attachments @Operation = @Operation, @TicketID = @TicketID不会像原始调用那样返回任何内容