Showing posts with label grouping. Show all posts
Showing posts with label grouping. Show all posts

Sunday, February 19, 2012

Data Type in DSV

I have Varchar column called "Age", which capture patient age. and I am trying to use grouping property of the Age dimension, since it is varchar type, the grouping is messed up, such as 20 - 4, 40 - 5. So I say, ok, I need to cast to int, so I change my age dimension to int, but the fact table need to be changed too, so I did cast(age as int) as Age, however I got error:

maxlength applies to string data type only, you cannot set column 'Age' property MaxLength to be non-negative number.

Any advice?

Dear Friend,

First when U Chages any data type in Fact Table. First remove all references in Cube. Suppose U want to change Age Datatype then first remove Age Measures from Cube or if any other reference is there like dimension using this field remove that from cube, then save, then process again. Now U can change that age datatype. Do fresh DataSourceView. Then add the things U removed. And Re-process your cube now this error will not come.

Friday, February 17, 2012

Data type change in SQL view

I've created a SQL View in SQL 2000 using a table that has columns
defined as Numeric data type. In the view, I am grouping and summing.
When I link the view via ODBC to Access, all of the data types are
changed to text. If I link the original table which the views are
created from to Access, the data types are correct. So this problem
obviously happens when I change the view to Group. Is there a way
around this? I want the data types to be correct in Access when I
link to the views.

thanks,

jimMR71 (mr71@.yahoo.com) writes:
> I've created a SQL View in SQL 2000 using a table that has columns
> defined as Numeric data type. In the view, I am grouping and summing.
> When I link the view via ODBC to Access, all of the data types are
> changed to text. If I link the original table which the views are
> created from to Access, the data types are correct. So this problem
> obviously happens when I change the view to Group. Is there a way
> around this? I want the data types to be correct in Access when I
> link to the views.

Not that I know anything about the Access part of this, but it
could help if you post the CREATE TABLE statements for your tables
and the CREATE VIEW statement.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp