Why are table valued parameters to SQL Server stored procedures required to be input READONLY?

前端 未结 5 2040
广开言路
广开言路 2020-12-17 18:45

Can anyone explain the design decision behind preventing table valued parameters from being specified as output parameters to stored procedures?

I can\'t count the n

5条回答
  •  攒了一身酷
    2020-12-17 19:17

    Still in 2020, SQL version "Microsoft SQL Azure (RTM) - 12.0.2000.8", I am not able to edit the Table value parameter within the Stored Procedure. So I did the work around by moving the data into Temp table and edited it.

    ALTER PROCEDURE [dbo].[SP_APPLY_CHANGESET_MDTST09_MSG_LANG]
        @CHANGESET AS [dbo].[MDTSTYPE09_MSG_LANG] READONLY
    AS
    BEGIN
    
        SELECT * INTO #TCHANGESET FROM @CHANGESET 
    
        UPDATE #TCHANGESET SET DTST08_MSG_K = 0 WHERE ....
         ...............
    

提交回复
热议问题