user log {ts '2024-10-09 10:19:01'} SQL declare @ownerId int = ?; declare @ownerType varchar(3) = ?; declare @fspro_userId int = ?; with data as ( select fspro_userId, ownerId, fsl_tablecode, nullif( firstName, '' ) firstName, nullif( lastName, '' ) lastName, nullif( organization, '' ) organization, nullif( address1, '' ) address1, nullif( address2, '' ) address2, nullif( city, '' ) city, nullif( state, '' ) state, nullif( zipCode, '' ) zipCode, nullif( phone, '' ) phone, nullif ( cellPhone, '' ) cellPhone, nullif( email, '' ) email, nullif( title, '' ) title, staffMember, loginEnabled from tbl_FSPro_members with (nolock) where ownerId = @ownerId and fsl_tablecode = @ownerType and fspro_userId = @fspro_userId ) , data_preData as ( select * from data where ( 1 = 1 ) ) , data_data as ( select * , count(*) over() as fseRowCount from data_preData ) , data_return as ( select * from data_data where 1 = 1 order by lastName offset 0 rows fetch next 10000000 rows only ) , data_result as ( select ( select count(*) from data_data ) as totalCount, ( select * from data_return for json auto, include_null_values ) as data ) select * from data_result for JSON PATH, INCLUDE_NULL_VALUES, WITHOUT_ARRAY_WRAPPER -- 21 -- MSC -- 135328 {ts '2024-10-09 10:19:10'} SQL declare @ownerId int = ?; declare @ownerType varchar(3) = ?; declare @fspro_userId int = ?; with data as ( select fspro_userId, ownerId, fsl_tablecode, nullif( firstName, '' ) firstName, nullif( lastName, '' ) lastName, nullif( organization, '' ) organization, nullif( address1, '' ) address1, nullif( address2, '' ) address2, nullif( city, '' ) city, nullif( state, '' ) state, nullif( zipCode, '' ) zipCode, nullif( phone, '' ) phone, nullif ( cellPhone, '' ) cellPhone, nullif( email, '' ) email, nullif( title, '' ) title, staffMember, loginEnabled from tbl_FSPro_members with (nolock) where ownerId = @ownerId and fsl_tablecode = @ownerType and fspro_userId = @fspro_userId ) , data_preData as ( select * from data where ( 1 = 1 ) ) , data_data as ( select * , count(*) over() as fseRowCount from data_preData ) , data_return as ( select * from data_data where 1 = 1 order by lastName offset 0 rows fetch next 10000000 rows only ) , data_result as ( select ( select count(*) from data_data ) as totalCount, ( select * from data_return for json auto, include_null_values ) as data ) select * from data_result for JSON PATH, INCLUDE_NULL_VALUES, WITHOUT_ARRAY_WRAPPER -- 21 -- MSC -- 135328