USE [AO08]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[sp_insert_sys_msg]
@type = N'2',
@msg = N'abc',
@msg_from = N'张山',
@msg_to = N'0003'
SELECT 'Return Value' = @return_value
GO
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[sp_insert_sys_msg]
@type = N'2',
@msg = N'abc',
@msg_from = N'张山',
@msg_to = N'0003'
SELECT 'Return Value' = @return_value
GO
创建存储过程:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[sp_insert_sys_msg]
-- Add the parameters for the stored procedure here
@type varchar(20),--变量
@msg varchar(20),--汉字内容
@msg_from varchar(20),--汉字姓名
@msg_to varchar(20) --
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @susercode varchar(50);
select @susercode = '';
select @susercode = user_code from pd_user where [user_name] = @msg_from;
-- Insert statements for procedure here
insert into sys_msg([type],msg,msg_from,msg_to)
values(@type,@msg,@susercode,@msg_to)
END
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[sp_insert_sys_msg]
-- Add the parameters for the stored procedure here
@type varchar(20),--变量
@msg varchar(20),--汉字内容
@msg_from varchar(20),--汉字姓名
@msg_to varchar(20) --
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @susercode varchar(50);
select @susercode = '';
select @susercode = user_code from pd_user where [user_name] = @msg_from;
-- Insert statements for procedure here
insert into sys_msg([type],msg,msg_from,msg_to)
values(@type,@msg,@susercode,@msg_to)
END