Hi,
I have a list of string (with prefix '@') which are the same as my procedures parameter's list.
So when I am trying to access a string from this list, its give me the name of that parameter and not parameter value.
My SP is here
----
CREATE PROCEDURE MYSP(@Fname varchar(max),@Lname varchar(max))
AS
BEGIN
DECLARE @ParamList AS CURSOR
DECLARE @ParamName AS varchar(100)
SET @ParamList = CURSOR FOR SELECT pParameter FROM dbo.GetParameterList('Function')
//Function returns list of string which are parameter list @Fname,@Lname
OPEN @ParamList
FETCH NEXT FROM @ParamList INTO @ParamName
WHILE @@FETCH_STATUS = 0
BEGIN
Print @ParamName // I would like to print the value of parameter @Fname and not '@Fname'
FETCH NEXT FROM @ParamList INTO @ParamName
END
CLOSE @ParamList
DEALLOCATE @paramList
END
So how could I do this?
Thank you.
I have a list of string (with prefix '@') which are the same as my procedures parameter's list.
So when I am trying to access a string from this list, its give me the name of that parameter and not parameter value.
My SP is here
----
CREATE PROCEDURE MYSP(@Fname varchar(max),@Lname varchar(max))
AS
BEGIN
DECLARE @ParamList AS CURSOR
DECLARE @ParamName AS varchar(100)
SET @ParamList = CURSOR FOR SELECT pParameter FROM dbo.GetParameterList('Function')
//Function returns list of string which are parameter list @Fname,@Lname
OPEN @ParamList
FETCH NEXT FROM @ParamList INTO @ParamName
WHILE @@FETCH_STATUS = 0
BEGIN
Print @ParamName // I would like to print the value of parameter @Fname and not '@Fname'
FETCH NEXT FROM @ParamList INTO @ParamName
END
CLOSE @ParamList
DEALLOCATE @paramList
END
So how could I do this?
Thank you.