Dimensions and fact tables using SQL Server 2008
I'm supposed to create a dimension and fact tables with SQL Server 2008 using TSQL, but I got the following error message : Unknown object type 'DIMENSION' used in a CREATE, DROP, or A开发者_开发百科LTER statement.
and my code is :
CREATE DIMENSION dim_date
LEVEL jour IS t_date.a_date
LEVEL jour_du_mois IS t_date.a_jourmois
LEVEL jour_de_annee IS t_date.a_jourannee
LEVEL semaine_de_annee IS t_date.a_semaineannee
LEVEL mois IS t_date.a_mois
LEVEL annee IS t_date.a_annee
HIERARCHY date_relative (
jour CHILD OF
jour_du_mois CHILD OF
mois CHILD OF
annee
)
HIERARCHY date_absolue (
jour CHILD OF
jour_de_annee CHILD OF
semaine_de_annee CHILD OF
annee
)
;
I have already created the table named t_date.
Please if someone can help me to do that.
This is one of the many areas where Oracle and SQL Server take completely different approaches to the same problem.
The SQL Server database engine has no direct equivalent of the Oracle CREATE DIMENSION statement, and there is no way to define one using the T-SQL language; instead, the SQL Server product includes a seperate OLAP engine - SQL Server Analysis Services.
SQL Server OLAP dimension and cube definitions are created through the Business Intelligence Development Studio - they are stored in a repository independent of the SQL Serve database engine.
You can define tables in the database engine, and add dimensional data to them, but you don't get all the features of a DIMENSION
in Oracle SQL.
Write [Dimension]
, it is a reserved word in MSSQL
精彩评论