

Do not add columns with unique values in your model. Now the model is reduced to about 3.5 MB. Still having SalesOrderNumber and SalesOrderLineNumber in it.īut what If I remove all the unique columns? Such as CarrierTrackingNumber, CustomerPONumber, SalesOrderNumber and SalesOrderLineNumber. Then I replace my FactInternetSales with this query. I mark DimDate as date table and then deploy my model to the server. Then I will create a tabular model with the following tables Set MostLikelyUniqueVarchar = SUBSTRING(CONVERT(varchar(255), NEWID()), 0, 10) We will use AdventureWorksDW2012 as we always do.įirst I will add a couple of columns to my fact And the SSAS engine will not aggregate your data as good as it should. This will make your models larger then necessary. Unless you have a very good reason to do so. Such as order numbers and orderline numbers. One off the biggest mistakes out there is to add columns with unique values to a model. The first column is month number and the next column is the measure.īut we will have to change it so that the measure is the first column. The reason why you have to do this is that you need to have the measure as first column.Ī single summarize will produce this resultįILTER('Date', 'Date' = 2007) To make a query for trend you will have to use nested summarize. ROW("Internet total sales", CALCULATE(,įILTER('Date', 'Date' = 2008) ROW("Internet total sales", )Īnd with some filtering it might look like something like this The first DAX query is for creating a KPI in Datazen. So to help people getting started I will provide some 🙂 When I started working with Datazen I could not find to many samples out there. Drop my snapshot databaseĭROP DATABASE AdventureWorksDW2012_Mysnapshot Delete the snapshot and then my sample table. I want to restore my database from snapshotįROM DATABASE_SNAPSHOT = 'AdventureWorksDW2012_Mysnapshot'Ĭool. Lets try to rescue the day by restoring from my snapshot and then get the data from the database Select * from sys.databases where source_database_id is not null I can write some basic SQL to list all my snapshots.

Ouch… It looks really big 😦 But lets look at the actual disk usage We delete the table by accident.īecause snapshot files tend to get big I am really curious about the size of it.


Insert into mySuperImportantTable values (5, 'Secret 5')ĬREATE DATABASE AdventureWorksDW2012_Mysnapshot ONįILENAME = 'C:\db snapshotfile\AdventureWorksDW2012_Mysnapshot.ss' ) Insert into mySuperImportantTable values (4, 'Secret 4') Insert into mySuperImportantTable values (3, 'Secret 3') Insert into mySuperImportantTable values (2, 'Secret 2') Insert into mySuperImportantTable values (1, 'Secret 1') Lets start by creating a snapshot of the AdventureWorksDW2012 database and create a “super important” table.Ĭreate table mySuperImportantTable ( int, varchar(2000))
#Adventureworksdw2012 database update#
For example if you are doing a scary update or something you have the possibility to “roll back” these changes.ĭid you know that you could make snapshots even in SQL Server? The snapshot feature is most useful when you want to preserve the state of the database so you can return to the same state repeatedly. In these products you have a really useful feature called “snapshot”. I am working quite a lot with virtual machines in Hyper-V and VMWare.
