是否可以调试将用户定义的数据类型作为参数的存储过程?
编辑:调用它的语法是什么? (执行....)
我的类型:
CREATE TYPE [dbo].[FacturaInspeccion] AS TABLE( [sIdServicio] [nvarchar](3) NOT NULL, [nIdTipoInspeccion] [int] NOT NULL, [sIdTipoMotivoInspeccion] [nvarchar](2) NOT NULL, [nIdTipoVehiculo] [int] NOT NULL, [nBase] [real] NOT NULL, [nNoPeriodica] [real] NULL, [nTarifaConProyecto] [real] NULL, [nTarifaSinyecto] [real] NULL, [nTasaTrafico] [real] NULL, [nDescuento] [real] NULL, [nTotal] [float] NULL
)
GO
最佳答案
我意识到它只是一个表,所以我声明了类型,插入了值并调用了存储过程。
存储过程声明:
CREATE PROCEDURE [dbo].[spInsertarFactura]
@tableFacturaInspeccion FacturaInspeccion READONLY,
...
调用存储过程:
USE [DATABASE] GO
DECLARE @return_value intDECLARE @tablaTmp FacturaInspeccion
INSERT INTO @tablaTmp(sIdServicio,nIdTipoInspeccion,sIdTipoMotivoInspeccion, nIdTipoVehiculo, nBase, nNoPeriodica, nTarifaConProyecto, nTarifaSinyecto, nTasaTrafico, nDescuento, nTotal)
VALUES(79, 1, '00', 1, 2, 2, 2, 2, 2, 10, 100)EXEC @return_value = [dbo].[spInsertarFactura]
然后是调试时间。
关于sql-server - 调试具有用户定义数据类型的存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5638477/