|
I've been working on the following sp for a few days now. This is a stripped down version. It functions correctly, however when I run it (in the sql server mgt console), it returns the column as "(No column name)". Using "select @WrkStr AS StrOut" does not set the column name as StrOut. Any suggestions would be greatly appreciated.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[sp_Test]
@IncRecIdx int,
@TmpStr varchar(50),
@WrkStr varchar(8000)
AS
---------------------------------------------------------------------------------
set @TmpStr = (select case when chkInc_Abuse_Alleged = 1 then
'Abuse Alleged' else null end from Incident_4 where IncRecIdx = @IncRecIdx)
if len(@WrkStr) = 0 or @WrkStr is null
set @WrkStr = @TmpStr
else
set @WrkStr = @WrkStr + ', ' + @TmpStr
---------------------------------------------------------------------------------
set @TmpStr = (select case when chkInc_Burn = 1 then
'Burn' else null end from Incident_4 where IncRecIdx = @IncRecIdx)
if len(@WrkStr) = 0 or @WrkStr is null
set @WrkStr = @TmpStr
else
set @WrkStr = @WrkStr + ', ' + @TmpStr
---------------------------------------------------------------------------------
select @WrkStr AS StrOut
--exec sp_Incident_4_Test 1001
|