Showing posts with label manager. Show all posts
Showing posts with label manager. Show all posts

Monday, March 12, 2012

Row Count problem

I've got a table which I know has 10108 rows in (I've looped through the table with some C# code), yet, in Enterprise manager, when i right click and view properties, the ROWS returns 10043 - a difference of 65 rows!

Why is this?

BTW - not that it should make any difference, but its on SQL Server 2000 standard edition.run

select count(*) from tablename

That will give the true result. Then it will either be down to some dodgy stats/code in EM or your code ;)|||I know that! Like I said - I already KNOW how many rows are in the table - that isn't the issue. The issue is why the right click > Properties gives me a different answer. Even if I DROP the table, re-CREATE it and INSERT maybe 50 rows, I still don't get the correct number of rows that I input.|||You didn't explain that at all. You said you've used c# code and that maybe faulty. IF the count(*) is tallying with your c# code then fair enough. Is it?

Friday, March 9, 2012

row count

I opened a database in Entreprise Manager, selected a table, double clicked
on it, and the property window poped up. I read the Rows of the table. Then,
I righ clicked the table->Open Table->Query, and run a query to count the r
ows (based on the primary k
ey column). It came up with a different number. I'm sure the table wasn't up
dated during the process. So which number is the right number? Thanks.
Ed.select count(*) gives the correct number.
the number shown in enterprise manager is not always current.
read up on sp_spaceused and dbcc updateusage in bol.
Ed wrote:
quote:

> I opened a database in Entreprise Manager, selected a table, double clicked on it, and the
property window poped up. I read the Rows of the table. Then, I righ clicked the table->Ope
n Table->Query, and run a query to count the rows (based on the primary

key column). It came up with a different number. I'm sure the table wasn't updated during the proc
ess. So which number is the right number? Thanks.
quote:

> Ed.

Wednesday, March 7, 2012

Rounding error: Between flat file connection manager Source & OLE DB Connection Destination

I have a Rounding error: Between flat file connection manager Source & OLE DB Connection Destination (SQL Server 2005) in my Dataflow.

File looks like this lets call column names Col A,B,C,D

70410000 RD1 1223631.92 196042.42
70329000 ICD 11025.84 3353.88
71167300 COL 104270.59 24676.96

flat file connection manager settings: first row Column names then Advanced tab Col A float , Col B float , Col C string ,Col D float ,

OLE DB Connection Destination (SQL Server 2005)

CREATE TABLE [dbo].[PT_CUST_ABR](

[PARTY_NO] [float] NULL,

[PARTY_NAME] [varchar](75) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[TELECOMABR] [float] NULL,

[GENIABR] [float] NULL,

Problem: ColA (Source) Rounding error to PARTY_NO (Destination)

I have a field of text of in a flat file that the flat file connection manager Source picks up correctly “70000893”

However when it gets the OLE DB Connection Destination the data has changed to 70000896. That’s before its even Written to the database.

The only clue that something is wrong in the middle is the great Data viewer shows the number as 7.000009E+07

Other clues looking at the data it appears there is a rounding error on only the number that dont end in 00

ColA (Source) PARTY_NO (Destination)
71167300 71167296
70329000 70329000
70410000 70410000

Any ideas people?

Thanks in advance

Dave

Float type by definition is not precise, it holds about 7 decimal digits, so it is expected.

If you want to keep exact values, you should use types that are big enough to hold them. E.g. Int for ColA and Decimal for ColC & ColD.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_fa-fz_6r3g.asp

|||

Thanks Michael--already tried that --turned out to the XML file in SSIS had my old settings locked in and my new settings in the flat file connection manager Source did not take effect

I fixed the problem by changing the datatype to string in the flat file connection manager and bigint in the SQL Server 2005 table. However I needed to delete all the objects in the dataflow task and re-recreate them again.--this fixed the XML metadata problem

Dave