sqlserver 取掉某一列数据的空格
select ltrim(rtrim(cloumn)) from table
update table set code= ltrim(rtrim(cloumn))
set @sql='SELECT * FROM
(
SELECT ROW_NUMBER() OVER (order by usercode asc, name '+ @nameOrderBy+' ,att_date asc) AS RowNumber, COUNT(1) OVER() AS TotalCount, * FROM #temptable
) AS overtimedetail
WHERE RowNumber BETWEEN '+ convert(nvarchar,( ( ( @pageIndex - 1 ) * @pageSize ) + 1 ))+'AND '+ convert(nvarchar, ( @pageIndex * @pageSize ))
exec(@sql)