I Have th efollowing stored proceedure that is suppose to create a key val:
ALTER
PROCEDURE [dbo].[GenerateNCRId]
@Division
varchar(3),
@DeptCode
varchar(3),
@NCRDetailsID
varchar(50),
@NCRCode
Nvarchar(3)
AS
SET
NOCOUNTON;
BEGIN
Declare
@NCRShortName asNVARCHAR(MAX)
Set
@NCRShortName =N'Select NCRShortName from NCRTypes where NCRTypeID=@NCRCode'
Create
Table #NCRIDs(
NCRID
Varchar(MAX)
)
insert
into #NCRIDs(NCRID)
values(@Division+'-'+@DeptCode+'-'+@NCRShortName+'-'+@NCRDetailsID)
Select
*from #NCRIDs
exec
sp_executeSQL@NCRShortName,N'@NCRCode as Nvarchar (3)', @NCRCode
END
however this is what is returned. i am definitely missing a step.
please help