
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER function [dbo].[podajEmisje]
(
@reklamaId int
)
returns nvarchar(1024)
as
begin
declare @emisje nvarchar(1024)

select 
	@emisje = coalesce(@emisje + ', ','') + cast([Nr wydania] as nvarchar(4))
	from dbo.[UKAŻE SIĘ W NR] 
	where reklamaId = @reklamaId
	order by [Nr wydania]

return @emisje
end
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

