问个存储过程的问题
暗石绿 2003-07-22 12:33:30 CREATE PROCEDURE get_Test
@name varchar(80), -- This is the input parameter.
@count int=0,
@Msg varchar(80)='关键字重复!' OUTPUT -- This is the output parameter.
AS
-- Get the sales for the specified title and
-- assign it to the output parameter.
SELECT @count = count(name)
FROM test
WHERE name = @name
if(@count>0)
begin
print @count
--@Msg = '关键字重复!'
end
else
begin
insert into test(name) values(@name)
print '成功插入'
end
GO
------------------------------------------------------------------
-- 我希望在程序中能获取“关键字重复!”和“成功插入”这两个信息
-- 请问在程序中应该怎么写?存储过程要怎么修改?