i getting above error in sp. (table storage) columns maxweight, height, width, & depth float. anyideas?
use [induction] go /****** object: storedprocedure [dbo].[usp_getstoragedetails1] script date: 06/14/2013 14:39:33 ******/ set ansi_nulls on go set quoted_identifier on go alter procedure [dbo].[usp_getstoragedetails1] @rowid int, @warehouseid int, @query varchar(100), @sortcol varchar(100), @sortorder varchar(100), @total int output begin select * #paging ( select row_number() on (order case when @sortcol='warehouseid' , @sortorder = 'asc' w.id end asc, case when @sortcol='warehouseid' , @sortorder = 'desc' w.id end desc, case when @sortcol='name' , @sortorder = 'asc' w.name end asc, case when @sortcol='name' , @sortorder = 'desc' w.name end desc, case when @sortcol='name' , @sortorder = 'asc' st.name end asc, case when @sortcol='name' , @sortorder = 'desc' st.name end desc, case when @sortcol='code' , @sortorder = 'asc' (isnull(s.identifiera,'')+ '-' + isnull(s.identifierb,'') + '-' + isnull(s.identifierc,'') + '-' + isnull(s.identifierd,'')+ '-' + isnull(s.identifiere,'')) end asc, case when @sortcol='code' , @sortorder = 'desc' (isnull(s.identifiera,'')+ '-' + isnull(s.identifierb,'') + '-' + isnull(s.identifierc,'') + '-' + isnull(s.identifierd,'')+ '-' + isnull(s.identifiere,'')) end desc, case when @sortcol='dimension' , @sortorder = 'asc' (isnull(height,'')+ 'x' + isnull(width,'') + 'x' + isnull(depth,'')) end asc, case when @sortcol='dimension' , @sortorder = 'desc' (isnull(height,'')+ 'x' + isnull(width,'') + 'x' + isnull(depth,'')) end desc ) rowid , w.id , st.name [type] , w.name warehouse ,(isnull(s.identifiera,'')+ '-' + isnull(s.identifierb,'') + '-' + isnull(s.identifierc,'') + '-' + isnull(s.identifierd,'')+ '-' + isnull(s.identifiere,'')) code ,maxweight ,s.height ,s.width ,s.depth ,(isnull(height,'')+ 'x' + isnull(width,'') + 'x' + isnull(depth,'')) dimension storage s left join warehouse w on s.warehouseid = w.id left join storagetype st on s.storagetypeid = st.id group s.id ,w.id ,st.name ,w.name ,s.identifiera ,s.identifierb ,s.identifierc ,s.identifierd ,s.identifiere ,maxweight ,s.height ,s.width ,s.depth having w.name '%' + @query + '%' or st.name '%' + @query + '%') listing select * #paging id=@warehouseid or rowid =@rowid select @total = count(*) storage s left join warehouse w on s.warehouseid = w.id left join storagetype st on s.storagetypeid= st.id w.name '%' + @query + '%' or st.name '%' + @query + '%' drop table #paging end
your isnulls should floats not '' empty strings
(isnull(height,0.0)+ 'x' + isnull(width,0.0) + 'x' + isnull(depth,0.0)) dimension
i check other isnulls well, make sure returning value type want.
Comments
Post a Comment