CREATE procedure [C6MartPeriodico].[AppRendTabReader]
	@ColumnSql varchar(5000),
	@whereSql varchar(5000)
AS
BEGIN
DECLARE @mywhere varchar(4000);
DECLARE @myselect varchar(5000);
DECLARE @mystmt varchar(5000);
SET @myselect = ' SELECT  '+ @ColumnSql;	
--SET @myselect = ' SELECT TOP(3000)* ';	
SET @mywhere = ' WHERE '+ @whereSql;	
SET @mystmt = @myselect + ' FROM [C6StampeCentralizzate].[C6MartPeriodico].[tabellone] ' + @mywhere + 'order by codice_fiscale';
EXEC( @mystmt )
END