Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 528.7k

Displaying No Data

Aug 15 2023 3:29 PM

Hi

  I have beow query but it is not displaying any Data.

Alter PROCEDURE sp_color 
	-- Add the parameters for the stored procedure here
	--<@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>, 
	--<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    DECLARE @body NVARCHAR(MAX)
SET     @body = N'<table>'
    + N'<tr><th>AcctCode</th><th>AcctName</th></tr>'
    + CAST((
        SELECT  p.AcctCode AS td,
                p.AcctName AS td
        FROM    Oact p
        FOR XML RAW('tr'), ELEMENTS
    ) AS NVARCHAR(MAX))
    + N'</table>'
END
GO

Thanks


Answers (4)