Blog

Creating Reports with SQL Server Reporting Services

By Carina C. Terms used in Reporting Services: ·         Data Source ·         Data Set: query related to a data source ·         Data Region: object that displays data Types of Data Regions: ·         Table: Tabular report ·         Matrix ·         List: free form enlisted data ·         Graphics Creating Reports in Reporting Services Reporting Services offers the following ways to create a Report: ·         Add New Report Wizard (Templates) ·         Add/Add New Item. Creates a blank report ·         Import Reports. It allows the importation of reports from an Access database Report using Tables Data View 1.       Select <New Dataset…> 2.       Assign a na...

Dynamic Management Views (DMV)

By Otoniel D. Hi everyone, last week I had to make a quick research about Dynamic Management Views (DMV) so I could create a quick technical session to give to my colleagues; a quick overview about this particular subject. I really have to admit that I enjoyed it a lot. Mainly because I believe that DMVs are one of the greatest features that Microsoft SQL Server have. But now that I’m writing this post, I found out that DMV’s are actually categorized. This means basically two things. First, that the sys schema is so intuitive that it allows you to use it easily and second that I need to look at the MSDN SQL Server 2008 Books Online more closely. J Let’s take a look about how do I fin...

Microsoft® SQL Server® 2008 System Views

By Otoniel Diaz We are always looking our databases as a bunch of tables and columns designed to store the data according to an application requirements. But when you are in charge of talking care of these tables and rows you actually need to review you start to wonder how to do it, and how SQL Server does manage the so called Metadata. Microsoft SQL Server 2008 metadata is represented in system views which are divided in 16 main categories.   System views objects can belong to a different type of objects which can be: 1.       Dynamic Management View 2.       Dynamic Management Function () 3.       Catalog View 4.       System Administration The most famous view may be is the ...

How to send a Scheduled HTML report directly from SQL Server

By Gabriel Palma   The situation A customer asked recently for a quick daily report of about-to-expire items, he wanted something simple that could be sent via email to the people already registered in the database. Acquiring the information was very simple (as simple as writing a query). The problem was getting those results inside an email and sending it automatically every day. We came up with a scheduled SQL Server job running daily, getting and shipping the results without passing through .Net code.   The steps Step 1. Write the query to retrieve the raw data.   I used AdventureWorks database for the following example. Here I’ll get a report of work orders with due date ...

How to send a list of parameters to a stored procedure.

Have you ever faced the need to send a list of parameters to a stored procedure? A nice and simple solution is the user-defined table type, which is available in SQL Server 2008.   First, we need to create the user defined type:   CREATE TYPE [dbo].[SongsType] AS TABLE(        [Id] [int] NOT NULL,        [Name] [varchar](100) NOT NULL,        [Artist] [varchar](100) NULL, )   In our code, we will create and populate a DataTable:   var dtSongs = new DataTable("Songs");             dtSongs.Columns.Add(new DataColumn("Id", typeof(int))); dtSongs.Columns.Add(new DataColumn("Name", typeof(string))); dtSongs.Columns.Add(new DataColumn("Art...

The timeout period elapsed prior to completion of the operation or the server is not responding.

“Command Timeout” is not equal to “Connection Timeout”.   A few days ago I had an application that was throwing the following error:   “Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding…”   It was an obvious error, a database timeout. I reviewed the Connection String and it didn’t have the property “Connection Timeout” (The default connection timeout is 30 seconds). So I added the property and set it to 600 seconds.   <connectionStrings> <add name="ConnectionString" connectionString="Data Source=localhost\SQLEXPRESS;Integrated Security=SSPI;Connection Timeout=600;" /> </connecti...

WMI Event sequences for database mirroring.

In my last post, I covered how WMI can help us monitor mirroring in SQL Server 2005. Before I post the code, let me explain a few more things.   Originally, the code was supposed to be really simple:   1 - Connect to both principal and mirror servers. 2 - Listen in for relevant events. 3 - Fire events when Automatic Failover and Manual Failover occurs.   While, conceptually this is all we need to do, the WMI events generated for mirroring events are not that simple.   In the following event sequences, there are two servers:   Server A – Originally configured as the mirror Server B – Originally configured as the principal   These discussions assume the presence of a witn...

5 Steps to Database Synchronization Part 1

This article is the first part of a series of three where we are going to demonstrate step by step how to synchronize a client database (SQL Server Express 2008) with a server database (SQL Server 2008) using Microsoft Synchronization Services through an N-Tier architecture supported by WCF. Let’s suppose we have an application used by insurance agents to sell insurance policies on the field. The application can work offline and needs the ability to synchronize the data with the main server database. For the sake of simplicity, we will only be synchronizing one table (Policies). The insurance agents should not be able to access all of the policies, only the policies sold by them, so we ...

LINQ to SQL and WCF

This is the scenario… We already have our LINQ DataContext and we need to receive/send info through a WCF service, what can we do to accomplish this?Option A. - Convert our LINQ entities to data contracts, to do this we just need to modify the Serialization Mode property from None to Unidirectional, right click in any area in the dbml and select properties. Doing this our LINQ objects are going to have the attributes [DataContract()] and [DataMember] as show in the figure 2. A few questions come to my mind (for sure there are a couple of more and for sure not all the options showed here are going to cover all the cases, hopefully a good part of)… What if we don’t need/want to send all th...