日期:2014-05-17 浏览次数:20465 次
CREATE PROCEDURE spGetWageRecordSQL @NAME VARCHAR(10), @SQL VARCHAR(MAX) OUTPUT AS SET @SQL='SELECT xm AS 姓名' SELECT @SQL=@SQL+ ',['+ xmdm + '] AS ['+xmmc+']' FROM gz_xmb ORDER BY DISP_ORDER SET @SQL = @SQL + ' FROM gz_dygzb WHERE xm=''' + @NAME + '''';
CREATE FUNCTION fnGetWageRecord( @Sql VARCHAR(MAX), @Name VARCHAR(10)) RETURNS TABLE AS BEGIN SET @Sql= EXEC(spGetWageRecordSQL(@Name,@Sql)) RETURN(EXEC(@Sql)) END