SQL Server定时调用指定WebApi接口

2024-01-08 17:30:53

SQL Server定时调用指定WebApi接口 

JOB of Steps:

DECLARE @ApiUrl VARCHAR(2000)
DECLARE @RequestType VARCHAR(5)
DECLARE @ResponseText NVARCHAR(4000)
SET @ApiUrl = 'http://192.168.1.169/sit-qualityapi/QC_ExceptionRecord/SendOAMessage_ExceptionRecord'
SET @RequestType = 'POST'
EXEC Proc_CallWebApi @ApiUrl,@RequestType, @ResponseText OUTPUT

Proc_CallWebApi 

 
 
/****** Object:  StoredProcedure [dbo].[Proc_CallWebApi]    Script Date: 1/8/2024 2:36:11 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Proc_CallWebApi]
    -- Add the parameters for the stored procedure here
    @ApiUrl VARCHAR(200), --api请求地址
    @RequestType VARCHAR(5),--请求类型:POST,GET
    @ResponseText NVARCHAR(4000) OUTPUT
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT stateme

文章来源:https://blog.csdn.net/lybwwp/article/details/135455492
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。