Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
irehman
Starting Member
22 Posts |
Posted - 2005-06-26 : 21:44:23
|
| Platform: Windows 2000DB: SQL Server 2000Problem: Once in a while query returns wrong count (total number of rows).I searched the Microsoft website and found followinghttp://support.microsoft.com/default.aspx?scid=kb;en-us;824018I implemented the work around, but problem still exsists.Any ideas?Thanks in Advance |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
irehman
Starting Member
22 Posts |
Posted - 2005-06-27 : 11:40:31
|
| Here is the information you requestedTable create script:CREATE TABLE [dbo].[PART_DETAIL] ( [PART_SN] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [JOB_ID] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [CELL_ID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [LAST_TASK_COMPLETED] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [REJECT_FLAG] [bit] NOT NULL , [FINAL_TEST_FLAG] [bit] NOT NULL , [PACK_ID] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [PARTIAL_COMPLETE_FLAG] [bit] NOT NULL , [REJECT_REASON] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY]GO2. Post some sample data in the form of DML--sn = TBR2033C132461103 -- job = '92828282' cell = '01' INSERT INTO PART_DETAIL (PART_SN,JOB_ID,CELL_ID) VALUES (rtrim(@SN),@Job,@Cell) 3. Post whatever DML that you have attempted alreadySELECT @SN = COUNT(PART_SN) FROM PART_DETAIL Where SUBSTRING(RTRIM(PART_SN),9,5) = Rtrim(@Shift) + Rtrim(@YY) + Rtrim(@JDate) ---- ex: '15178'AND SUBSTRING(RTRIM(PART_SN),15,1) = right(rtrim(@Cell),1) ---ex : '1' 4. Post the expected resultsAbove query suppose to bring exact count of rows from the table, but sometimes it brings wrong count. Table has 200,000+ rows.Thanks |
 |
|
|
|
|
|
|
|