sql server - Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" -
I have a dynamic sql statement when I am performing that statement, I am getting the error Collation conflict "SQL_Latin1_General_CP1_CI_AS" I used the match Especially when I'm sending the track number, error is happening, then here I feel that error lies Here my SQL becomes easy Announced as
ALTER PROC SearchByJID (@JID VARCHAR), @TrackNo VARCHAR (maximum), @PageSize INT, @PageNumber INT) @SQL VARCHAR (Max) declared @Count_SQL VARCHAR (MAX) @ROWS Tart announcement announces INT announcement @RowEnd INT @PageNumber = @PageNumber - 1 set @RowStart = @PageSize * @PageNumber + 1 set @RowEnd = @RowStart + @PageSize - 1 set @ SQL = 'set @ Count_SQL =' set Start (@bbajobs) order .JID) as the RowNumber, [BBAJobs]. [JID], [AccountReference] [ACC ref], as the starting @ SQL = 'Select * (Selection ROW_NUMBER) [BERA] , [JobDescription], [CallRem]. [RAM], [CallRem]. [CallStatus], [CallRem] [ShopRemarks], CustomerNotes, ShopNotes, RecievedDate, dbo.BBAJobs Get usernames from the Left External dbo.CallRem on dbo.BBAJobs.JID = dbo.CallRem.jid where 1 & lt; 2 'If @TrackNo & lt; & Gt; '' In the start set @ sql = @ sql + 'and [bbajobs] (from trackdetail to JID in TRACKNO (select CONVERT (Select VARCHAR, data) .jid ([JID] dbo.Split1' '' ' + @ TrackNo + '' ',' ',' ')))' End if LTRIM (RTRIM (JID)) & lt; & Gt; '' JID + '' '+' JID + '' '', '', '', '', '', '' @ '+' @ in start set @ sql = @ sql + 'and [bbajobs] (select varnish (VARCHAR, data) as dbo.Split1 ([JID] ') .jid)' Set End '@ SQL = @ SQL +' 'x Where between' RowNumber '+' Cast (@RowStart as VARCHAR) + '- and select COUNT (bbajobs' + Cast (@RowEnd VARCHAR) ) Get the number @ Count_SQL = SET '. [JID]) Join dbo.BBAJobs Exclude External Dbo.CallRem on dbo.BBAJobs.JID = dbo.CallRem.jid where 1 & lt; 2 'If @TrackNo & lt; & Gt; Select 'JID from start date' Count_SQL = @ Count_SQL + 'and (bbajobs.jid trackdetail, where in TRACKNO (converted as VARCHAR, data) from [JID] dbo.Split1 (' '' + + TrackNo + Select '' ',' ',' ')))' End if LTRIM (RTRIM (JID)) & lt; & Gt; '' SET @ Count_SQL = @ Count_SQL + start '' and 'bbajobs.jid' (Choose VARCHAR, Data) ([JID] dbo.Split1 to '' '+ @ JID +' '', '', '' )) END END Executive (@ SQL + @ Count_SQL)
If the track no & lt; & Gt; '' In the start set @ sql = @ sql + 'and [bbajobs] (from trackdetail to JID in TRACKNO (select CONVERT (Select VARCHAR, data) .jid ([JID] dbo.Split1' '' ' + @ TrackNo + ''
I did this way & solve the problem
If @TrackNo <<> start set @ sql = In @SQL + 'and [bbajobs] (from Trackdetail to JID where TRACKNO is in the DATABASE_DEFAULT select Selection Selection .jid data as DATABASE_DEFAULT [JID] dbo.Split1 (' '' + TrackNo + '' ''
set @ sql = @ sql + 'and [bbajobs] (trackdetail of jid) Do not disturb the database_default ('' '+ TrackNo +' ',' ',' ')) in the TRACKNO database_default (Choose Change (VARCHAR data comparison), as jid [JID] dbo.Split1 / Code>
Comments
Post a Comment