Drill Down Report SSRS with the Visibility Property

by Ali Raza Zaidi on January 25, 2012

Too the point, opens your Reporting Services project in BIDS and add report menu.  The database is used in report can be download from here

http://tsql.solidq.com/books/tsqlfund2008/

 

 

 

Select new report like as

After creating new report you have to add new dataset form data source panel.

In Dataset Properties window you have to use dataset from already created and shared dataset or create new one which is embedded into you report, I select the embedded option.

For data source I used already created and shared data source for local instance of Sql server

I add the following Query for report creation.

SELECT P.productId,p.Productname,p.CategoryId,P.unitPrice,c.categoryId, c.categoryName,s.companyname,s.ContactName,s.Address,s.City FROM production.products as p
INNER JOIN production.Suppliers s

ON p.supplierid = s.supplierid

INNER JOIN Production.Categories c
ON C.categoryId = p.categoryId

Add a new table on report designer area

Right click on report design area and Table form . and drop fields like follow.

When I click on preview button, I found following report.

Now on design pane. Right click on report and add new parent group as

Select CategoryName as Group header.

Now go at the bottom of report

Select the visibility selection from Group and select display options as follow.


Press ok and click on preview button, Report should be look like as

Now click on + sign The report will open like as

Nice starting point cheers :)

SSIS Community Tasks and Components

by Ali Raza Zaidi on January 23, 2012

There are hundreds of free SSIS tools available, which provide additional functionality. Codeplex listed them as http://ssisctc.codeplex.com/. These divided into following sections

  • Tools
  • Connection Managers
  • Log Providers
  • Task (for Control Flow)
  • Foreach Enumerators
  • Script Task Script Samples
  • Components ( for Data Flow)
  • Script Component Samples
  • Sources
  • Transforms
  • Destinations

cannot transfer unicode to non-unicode string ssis

by Ali Raza Zaidi on January 18, 2012

Today I face the following Error, when I transfer data from excel file to sql server server through SSIS package.

Problem is that in excel data is stored in Unicode. And  transfer data to field of sql server which is define as varchar.

 

Solution 1. Change the sql data type   to nvarchar instead varchar. Unicode sql table will be define as

 

CREATE TABLE [dbo].[Product](

[ProductName] [nvarchar](50) NULL,

[ProductDetail] [nvarchar](50) NULL

) ON [PRIMARY]

Now try again. Data will successfully migrate. But this not good solution.

 

Solution 2

Work around to this problem is use data Conversion task between the excel source and destination sql server  As

 

So to get around this problem we have to also use a Data Conversion task.

 

BIDS Helper

by Ali Raza Zaidi on January 18, 2012

http://bidshelper.codeplex.com/

There are many advantages in using this tool…
1. The first thing which I use this is for checking the dimension health, this is very helpful especially when you are dealing with the hierarchies…this helps in checking the data which is violating the hierarchy rule like data with many to many relationship etc…
2. There are many other useful options available like smartdiff (for finding the difference in code between versions), Deleting the Report Dataset Catch files (to make sure we see the refreshed data), Roles Report (gives the detail on the roles used in the cube) etc…
I would strongly recommend using this tool as this helps in improving and analysing many things while doing the BI development work.

A Visual Studio.Net add-in with features that extend and enhance the functionality of the SQL Server 2008 BI Development Studio (BIDS).

 

Features

 

MSDN Virtual Labs for BI project

by Ali Raza Zaidi on January 17, 2012

AdventureWorks2008R2 download link

by Ali Raza Zaidi on January 17, 2012

Are you searching the download location for sample Databases for Microsoft SQL Server 2008R2 RTM (May 2010) ?

You can download it from Click here

It contains the complete set of databases:
- AdventureWorks
- AdventureWorks2008R2
- AdventureWorksDW2008R2
- AdventureWorksLT
- AdventureWorksLT2008R2

 

Vitamins F! F for friends

by Ali Raza Zaidi on January 16, 2012

Why do I have a variety of friends who are all so different in character?  How can I get along with them all?  I think that each one helps to bring out a “different” part of me.

With one of them I am polite.  I joke with another friend.

I sit down and talk about serious matters with one.  With another I laugh a lot.  I may have a coke with one.  I listen to one friend’s problems.  Then I listen to another one’s advice for me.

My friends are all like pieces of a jigsaw puzzle.  When completed, they form a treasure box.  A treasure of friends!  They are my friends who understand me better than myself, who support me through good days and bad days.  We all pray together and for each other.

Real Age doctors tell us that friends are good for our health.  Dr. Oz calls them Vitamins F (for Friends) and counts the benefits of friends as essential to our well being. Research shows that people in strong social circles have less risk of depression and terminal strokes. If you enjoy Vitamins F constantly you can be up to 30 years younger than your real age. The warmth of friendship stops stress and even in your most intense moments it decreases the chance of a cardiac arrest or stroke by 50%.

I’m so happy that I have a stock of Vitamins F!

In summary, we should value our friends and keep in touch with them.  We should try to see the funny side of things and laugh together, and pray for each other in the tough moments.

Thank you for being one of my Vitamins!

 

reference :  http://www.iceinspace.com.au/forum/showthread.php?t=84443

How to get Tables list in database TSQL

by Ali Raza Zaidi on January 15, 2012

 

Main object is sys.tables. you can get all information about tables by query on sys.tables.

 

User databasename

Select * from sys.tables;.

 

 

SELECT SCHEMA_NAME(schema_id) AS table_schema_name, name AS table_Name

FROM  sys.tables;

 

 

SCHEMA_NAME convert  schema_id into schema name.

Three TSQL books which every software developer must read

by Ali Raza Zaidi on January 15, 2012

In my seven years of development experience, I read my tutorial and books on programming as well as. But when we talk about sql server from developer ‘s perspective. The following books are best. From novice developer to expert Tsql developer I recommend these books. All these books are from Itzik Ben-gan

 

 

From Microsoft learning site

Microsoft® SQL Server® 2008 T-SQL Fundamentals

 

http://www.microsoft.com/learning/en/us/book.aspx?ID=12806&locale=en-us

About The BookLearn T-SQL, write better code and queries, and extend your SQL Server knowledge

Master the foundations of T-SQL with the right balance of conceptual and practical content. Get hands-on guidance—including exercises and code samples—that show you how to develop code to query and modify data. You’ll gain a solid understanding of the T-SQL language and good programming practices, and learn to write more efficient and powerful queries.

Discover how to:

  • Apply T-SQL fundamentals, create tables, and define data integrity
  • Understand logical query processing
  • Query multiple tables using joins and subqueries
  • Simplify code and improve maintainability with table expressions
  • Explore pivoting techniques and how to handle grouping sets
  • Write code that modifies data
  • Isolate inconsistent data and address deadlock and blocking scenarios

 
Inside Microsoft® SQL Server® 2008: T-SQL Querying
http://www.microsoft.com/learning/en/us/book.aspx?ID=12804&locale=en-us
About The BookMaster the mechanics behind advanced querying and tuning—for faster, more scalable code 

Tackle the toughest set-based querying and query tuning problems—guided by an author team with in-depth, inside knowledge of T-SQL. Deepen your understanding of architecture and internals—and gain practical approaches and advanced techniques to optimize your code’s performance.

Discover how to:

  • Move from procedural programming to the language of sets and logic
  • Optimize query tuning with a top-down methodology
  • Assess algorithmic complexity to predict performance
  • Compare data-aggregation techniques, including new grouping sets
  • Manage data modification—insert, delete, update, merge—for performance
  • Write more efficient queries against partitioned tables
  • Work with graphs, trees, hierarchies, and recursive queries
  • Plus—Use pure-logic puzzles to sharpen your problem-solving skills

Inside Microsoft® SQL Server® 2008: T-SQL Programming
http://www.microsoft.com/learning/en/us/Book.aspx?ID=12805&locale=en-us

 

About The BookGet the in-depth architectural insights you need to exploit advanced T-SQL programming techniques.

Get a detailed look at the internal architecture of T-SQL with this comprehensive programming reference. Database developers and administrators get best practices, expert techniques, and code samples to master the intricacies of this programming language—solving complex problems with real-world solutions.Discover how to:

  • Work with T-SQL and CLR user-defined functions, stored procedures, and triggers.
  • Handle transactions, concurrency, and error handling.
  • Efficiently use temporary objects, including temporary tables, table variables, and table expressions.
  • Evaluate when to use set-based programming techniques and when to use cursors.
  • Work with dynamic SQL in an efficient and secure manner.
  • Treat date- and time-related data in a robust manner.
  • Develop CLR user-defined types and learn about temporal support in the relational model.
  • Use XML and XQuery and implement a dynamic schema solution.
  • Work with spatial data using the new geometry and geography types and spatial indexes.
  • Track access and changes to data using extended events, SQL Server Audit, change tracking, and change data capture.
  • Use Service Broker for controlled asynchronous processing in database applications.All the book’s code samples will be available for download from the companion Web site.

 

 

 

 

Microsoft SQL Server 2008 Virtual Labs for BI

by Ali Raza Zaidi on January 13, 2012

Want to learn BI with Sql Server 2008, you have to go through virtual labs. I found excellent links on msdn virtual lab page

http://msdn.microsoft.com/en-gb/cc138238


SQL Server 2008 R2 Virtual Labs