SQL Server

ReportViewer Control and ASP.NET

I read somewhere that you could embed SSRS in a .NET web page and the other day I thought this would be a good way to add few gauges. To start with, I created a new Report Server Project using Visual Studio 2008 BIDS.  After adding a data source and a simple dataset, I dragged three [...]



Database Mirroring

It’s not very often that I need to setup database mirroring and because it’s something I do rarely, I can never remember the exact syntax.  In the code below ServerP is the Principle, ServerM the mirror and ServerW the witness. — On ServerP CREATE ENDPOINT [Mirror] AUTHORIZATION [domain\sqladmin] STATE=STARTED AS TCP (LISTENER_PORT=7777, LISTENER_IP=ALL) FOR DATA_MIRRORING ( [...]



SQL 2012 – Windowed Functions

I recently installed a copy of SQL2012 RC0 and wanted to look at the new language features that have been added.  In particular the improvements to the OVER clause caught my attention as I could think of a scenario where this would be useful. Back in March of this year I created a blog entry called [...]



Dynamic Forms in ASP.NET Part 2

In a previous post I started looking at a sample application that could dynamically create forms in ASP.NET and then store the user input into a database. In this post I am going to continue by looking at the classes used to generate the web controls. As I mentioned in the first post I took [...]



Dynamic Forms in ASP.NET

As part of an ASP.NET application I recently created I wanted to add a capability that allowed power users to define set of questions that could be used by the application.  In other words, when the application needed changing to allow additional information to be stored, the users can make the changes themselves using a few [...]



SQL Filestream with ASP.NET

I inherited an asp.net application that stores documents as binary large objects in SQL Server.  I wanted to change the application to use SQL Filestream when storing and retrieving documents. I didn’t want to make major changes to the application and so used the following method to implement FileStream with the least effort. Before using FileStream [...]



Inline views with CTE’s

Every now and then I need to write a query that joins onto the same tables as in the example below.  Here the sales table has two columns representing two different employees and I need to return the name and department of each along with the sales amount and date. SELECT S.SalesAmount, S.SaleDate, E1.Name AS SellingEmployee, [...]



Resetting the Report Cache

When you enable caching on a report in SSRS, the first time the report is requested it will be executed against the source database, converted into an intermediate report format and then rendered to the screen (or another format if specified). The intermediate report format is saved to the Cache and any subsequent requests use [...]



Primary Entity and Outer Joins

In order to allow users to create their own ad-hoc reports from a data warehouse I developed a couple of report models using the business intelligence developer studio.  These models are hosted on a native mode SSRS installation and people can use Report Builder 3 to design and deploy reports. I had a query from a [...]



Changing Partitions with Split and Merge

I try to create my partitions so that each will contain roughly the same amount of rows.  After a while there are bound to be variances in the average number of rows in each partition.  For example, I have a partition scheme based upon office/location codes.  Some offices are busier than others and process a higher number of [...]