For our reporting services, we need to convert a lot SQL tables to HTML. This is the SP that can convert any table to HTML based on a SP created by Ian Atkin ([email protected]) The original post can be found here
The modified version supports converting tables having NULL cells & better styling
create PROCEDURE [dbo].[SqlTableToHtml] (
@TABLENAME NVARCHAR(500),
@OUTPUT NVARCHAR(MAX) OUTPUT,
@TBL_STYLE NVARCHAR(1024) = '',
@TD_STYLE NVARCHAR(1024) = '',