Archive for June, 2009

Post

Ignore_Dup_key Index Option

In Microsoft SQL Server,SQL Server 2005,SQL Server 2008 on June 17, 2009 by sqlapostle

The Ignore_Dup_Key is an index option that lets you specify the error response to a duplicate key value insert into a column having a unique clustered or unique non clustered index.

If you have Ignore_Dup_Key option set to ON for a unique index, when presented with a duplicate key insert into the column, it will issue a warning message only and rows violating the constraint will fail.

Set it to OFF and you will get an error message along with the transaction being rolled back and aborted.

Lets see some code which explains this , coz 10 lines of code are worth 100 lines of documentation :) .

   1:  Use PlayGround
   2:  -- Use your personal test database name here , mine's called the Playground 
   3:  GO
   4:  -- Lets create the Test Table 
   5:  CREATE Table MyDupKeyTest
   6:  (
   7:      KeyCol int
   8:      ,AnotherCol varchar(20)
   9:  )
  10:  GO
  11:  -- Create a unique index with the Ignore_dup_key set to ON
  12:  CREATE UNIQUE INDEX ixuc_MyDupKeyTest_KeyCol ON MyDupKeyTest(KeyCol) WITH (IGNORE_DUP_KEY = ON)
  13:  GO
  14:  -- Insert our test row
  15:  INSERT INTO MyDupKeyTest SELECT '1','SqlApostle'
  16:      17:  --Now lets try inserting another row with the duplicate values
  18:  BEGIN TRY
  19:      INSERT INTO MyDupKeyTest SELECT '1','SqlApostle'
  20:  END TRY
  21:  BEGIN CATCH
  22:      PRINT 'IN CATCH BLOCK'
  23:  END CATCH
  24:  -- Didn't reach the Catch block , there is only an warning issued
  25:      26:  GO
  27:  -- Now lets turn the option to OFF 
  28:  ALTER INDEX ixuc_MyDupKeyTest_KeyCol ON MyDupKeyTest REBUILD WITH (IGNORE_DUP_KEY = OFF )
  29:  GO
  30:  BEGIN TRY
  31:      INSERT INTO MyDupKeyTest SELECT '1','SqlApostle'
  32:  END TRY
  33:  BEGIN CATCH
  34:      PRINT 'IN CATCH BLOCK'
  35:  END CATCH
  36:  -- Into the catch block , error has occured
  37:  GO
 
Further on this in later posts

Post

Download Available (BI EVENING 10 JUNE Reading (UK):- Attribute Relationships, Aggregations and using MDX Studio to its best)

In MDX,SQL Server 2008 on June 13, 2009 by ashwaniroy

I was a speaker this BI evening at Microsoft Reading on Attribute Relationships, Aggregations and using MDX Studio to its best.

Setting proper relationships for the attributes of a dimension is essential from a query performance point of view. It is one of the most important things while dimensional modelling.
Aggregations are pre calculated summaries of cube data that help enable Microsoft SQL Server 2005 Analysis Services (SSAS) to provide rapid query responses. Aggregations are like fact table data grouped and aggregated to a higher level in the Hierarchy. Building the correct aggregations can greatly enhance query performance.
MDX Studio can be used to analyze complex MDX expressions, monitor performance characteristics of MDX queries and get insight into how MDX interacts with other UDM features such as attribute relationships. MDX Studio provides unique visualization representation of MDX expression and allows the user to interact with different stages of MDX execution. It is built by Mosha Pasumansky, who is inventor of MDX and one of the Architects of Microsoft Analysis Services.

The Slides and Demo is available for download here.

Post

June 10th BI Event in Reading

In SQL Server 2008 on June 1, 2009 by ashwaniroy

June 10th BI Event in Reading; SQL 2008 R2 & Gemini; Data Modelling to Info Architecture; Attribute Relationships, Aggregations & using MDX studio to its best

For more information and to register: http://www.sqlserverfaq.com/events/168/SQL-2008-R2-and-Gemini-From-Data-Modelling-to-Information-Architecture-and-Attribute-Relationships-Aggregations-and-using-MDX-Studio-to-its-best.aspx

Join us for another UK SQL Server User Group meeting.
5.30pm – 6:00 Registration and networking + Tea/Coffee with biscuits.
Meet and greet.
6:00pm – 6:15pm Round Table discussion and Nuggets – ALL
Take stock and get the latest news in the SQL Server field. This is also a great opportunity to ask any burning questions you have, may be a problem at work.
It’s also a great opportunity to share your knowledge and gain exposure in the industry by giving a short 1 – 6 minute "nugget" demo/tip.
6.15pm – 7:00pm Andrew Fryer, Microsoft

SQL Server 2008 R2 and Gemini
SQL Server 2008 R2 will be the release with Gemini in it. Gemini is about trying to marry self service BI for end users with proper control of that data for the IT Professional. The beta program has only been recently announced and so it’s still early days but if you want to know what to expect then this is your first real opportunity in the UK. So join Andrew Fryer for an hour of peering into what 2010 BI looks like
7:00pm – 7:45pm Alex Pratt and Andrew de Rozairo Sybase

From Data Modeling to Information Architecture
It used to be about doing the thing right: a tactical approach for data modelling was necessary, because all the data was contained within the same domain. Now it’s about doing the right thing. Management demands information that is strategic and which helps them make business decisions. This information is more complex, housed in multiple domains, created in different languages, and used by different areas of the organisation for opposing purposes. Adding to the complexity is the critical need for it to be timely, accurate and comprehensive. 
In this 45-minute session, Andrew de Rozairo and Alex Pratt of Sybase will impart the secrets of successfully building a foundation for a comprehensive and successful information architecture. You’ll learn how to take a new approach to modelling: combining the business view, information view and the technology view to achieve a strategic vision. 
7:45pm – 8pm BREAK: Light refreshments

More time to network and ask questions…
8pm – 8:15pm Vincent Rainardi
Nugget (demo) on SSAS
8:15pm – 9.00pm Ashwani Roy
Attribute Relationships, Aggregations and using MDX Studio to its best
Setting proper relationships for the attributes of a dimension is essential from a query performance point of view. It is one of the most important things while dimensional modelling.
Aggregations are pre calculated summaries of cube data that help enable Microsoft SQL Server 2005 Analysis Services (SSAS) to provide rapid query responses. Aggregations are like fact table data grouped and aggregated to a higher level in the Hierarchy. Building the correct aggregations can greatly enhance query performance.
MDX Studio can be used to analyze complex MDX expressions, monitor performance characteristics of MDX queries and get insight into how MDX interacts with other UDM features such as attribute relationships. MDX Studio provides unique visualization representation of MDX expression and allows the user to interact with different stages of MDX execution. It is built by Mosha Pasumansky, who is inventor of MDX and one of the Architects of Microsoft Analysis Services.
Speaker Bio’s
Andrew Fryer
Microsoft Evangelist specialising in Business Intelligence.
Ashwani Roy
Ashwani Roy is a Business Intelligence Consultant with IMGROUP with 5+ Years of experience in RDBMS and OLAP. He specialises in Database engine, SSIS and SSAS, C#, Design Patterns.
Ashwani is MCTS & MCITP in SQL Server 2005 and also has 2 patents in Business Intelligence domain.
Ashwani is also frequent blogger on www.sqlkit.com  and http://ashwaniroy.spaces.live.com  and one of the authors of Server 2008 MCP exams 451 (database solutions). He is also regular responder on Microsoft Forums 
Andrew de Rozairo
Andrew de Rozairo has focused on delivering business value through technology for the last 23 years. An Electrical Engineering and Computer Science degree from the Massachusetts Institute of Technology with an MBA from INSEAD, Europe’s leading Business School, provides him with a unique mix of technical and business perspective. Andrew has over 16 years in management roles in the Data Management Industry, including as CEO of a VC-backed encryption start-up, and European Managing Director of an American data monitoring software company. In his current role as Business Development Manager EMEA for Sybase, Andrew works with strategic clients and partners to develop and deliver business value propositions based on leading-edge Sybase modeling, metadata management and analytics technology solutions.

Follow

Get every new post delivered to your Inbox.