Skip to main content

Posts

Showing posts from November, 2011

Co-related Subqueries in RDBMS

Subquery is a query within a query i.e. the inner query runs one time and its result is used by the outer query. For e.g. Select Ename from emp where city = (Select city from CityMaster where cityid=102) In the above query the inner query runs only one and its result is used by the outer query. But sometimes developers encounter a situation such as: To find out all the employees who are getting salary greater than the average salary of their own departments. Now in this kind of query, for every outer query the inner query will calculate the average salary of the department and then it is compared with the outer query. So it means the inner query fires for every row in the outer query unlike the normal sub query. This is called as "Co-related SubQuery". The actual query will be: Select x.ename, x.salary, x.deptno from emp x where x.Salary  > (    Select avg(salary) from emp where deptno=x.deptno )

SQL Server Reporting Services Scale out Configuration

One of the major benefits that SQL Server provides is the scaling out the SQL Server Reporting Services. SQL Server Reporting Services are used as concept of hosting reports which various business processes requires. SQL Server Reporting Services does an efficient job in hosting all the reports. But the problem comes when the load starts increasing in terms of number of users accessing the reports. This may result in: 1.        Slow processing of SQL Server Reports 2.        Crashing of SQL Server Reports Server In order to overcome the above issue, SQL Server Reporting Services can be overcome through the concept of scalability. This is implemented with the help of network load balancing (NLB) and Domain Implementation. The following figure gives a clear cut picture of how to achieve the same: I n the above example, there are there servers in the NLB serving the clients through a Virtual NLB IP i.e. 192.168.1.25. The client only knows the Virtual IP, h