Posts

Showing posts from May, 2013

Test your Sql Query Online

Hi Guys i found a good tool to test simple Sql query online the link is as below. This time i used this to test the pivot functionality. The Pivot Sql Function converts the row wise category data into column wise metrix/pivot kind of data. http://www.sqlfiddle.com/#!3/b228e/3 another good example is below http://sqlfiddle.com/#!6/2ba07/131

Adding Metrix report to your existing report.

I was searching how to convert existing report to metrix report and below msdn link is best link i have found . http://msdn.microsoft.com/en-us/library/ms157334(v=sql.100).aspx

SSRS Lookup Joining through fields which have comma saperated data.

http://www.c-sharpcorner.com/uploadfile/mspress/chapter-9-reporting-services-enhancements/

SQLServer – Convert multiple rows into one row, comma delimited.

SQLServer – Convert multiple rows into one row, comma delimited. Working for my current client, one of the reports that needed to be built was an Order record that showed the items listed but as a comma delimited string.  Of course, the database tables show each item as a new record which is assigned to master order record.  You’ve all seen this before. Order Table OrderID OrderNumber 1 X1 2 X2 3 X3 Order Detail Table OrderID OrderDetailID Item 1 1 O1Item1 1 2 O1Item2 2 3 O2Item1 2 4 O2Item2 3 5 O3Item1 The SSRS report needs to show 3 records with the Items listed separated by commas. Order Items X1 O1Item1, O1Item2 X2 O2Item1, O2Item2 X3 O3Item1 I did some digging around on the internet and found a few options XML Recursive CTE Cursor I’m sure there are a few more out there, but these seemed to be the most reasonable. In the end, I decided to use the XML because it was much easier to write and performed well. Here is what I ended up w