-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
--
-- =============================================
CREATE FUNCTION [dbo].[GetRoleLevel]
(
@ID varchar(1000)
)
RETURNS varchar
AS
BEGIN
-- Declare the return variable here
DECLARE @Level varchar(4000)
-- Add the T-SQL statements to compute the return value here
SELECT @Level=name FROM dbo.products where id in (@ID)
-- Return the result of the function
RETURN @LevelEND
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
--
-- =============================================
CREATE FUNCTION [dbo].[GetRoleLevel]
(
@ID varchar(1000)
)
RETURNS varchar
AS
BEGIN
-- Declare the return variable here
DECLARE @Level varchar(4000)
-- Add the T-SQL statements to compute the return value here
SELECT @Level=name FROM dbo.products where id in (@ID)
-- Return the result of the function
RETURN @LevelEND
(
@ID varchar(1000)
)
RETURNS varchar
AS
BEGIN
-- Declare the return variable here
DECLARE @Level varchar(4000)
-- Add the T-SQL statements to compute the return value here
SELECT @Level=ISNULL(@Level+',','')+name FROM dbo.products CHARINDEX(','+id+',',','+@ID+',')>0
-- Return the result of the function
RETURN @LevelEND看楼主的意思应该是这样
服务器: 消息 170,级别 15,状态 1,过程 GetRoleLevel,行 9
第 9 行: ',' 附近有语法错误。