.NET news » Database Database Rss Feed

Common Table Expressions (CTE) in SQL Server 2005

When crafting a query in SQL, there are often times when we may need to operate over a set of data that doesn't inherently exist within the system. For example, the database for an eCommerce web application would have the standard tables - Products, Customers, Orders, OrderDetails, and so on - but we may need to run reports on a particular subset of the data or against aggregate data across these tables. Or the reporting queries we need might need to group or filter by results returned by scalar subqueries. Typically, views are used to break down complex queries into digestible chunks or to provide scalar subquery results that can be grouped and filtered. Views, however, are sometimes overkill, as they are permanent objects at the system-level. If we only need to reference this complex query in a single stored procedure or UDF, another option is to use a derived table. Unfortunately, derived tables muddle the readability of the query and must be repeated for each use in a statement..
18 Jul 2006, 19:00:00   Source: Common Table Expressions (CTE) in SQL Server 2005   Tags: Database

SQL Server 2005 Query Notifications Tell .NET 2.0 Apps When Critical Data Changes

.NET 2.0 and SQL Server 2005 combine in Query Notifications to notify applications when critical data changes occur and eliminate the need to repeatedly ask the database, "Has it changed yet?"
28 Jun 2006, 18:45:07   Source: SQL Server 2005 Query Notifications Tell .NET 2.0 Apps...   Tags: Database

Database Concurrency Conflicts in the Real World

A lot of articles have been written about database concurrency conflict detection and the various ways of handling them.Unfortunately most of these articles, and accompanying solutions, have one major flaw in that they focus on the technical issues and database implementation instead of real-world data and how people use the data. In this article, I will try to show the difference between focusing on the database implementation and on the real-world data. I will show some possible approaches on how to solve these concurrency issues.

15 Jun 2006, 19:00:00   Source: Database Concurrency Conflicts in the Real World   Tags: Database

Dissecting and Putting the Visual Studio 2005 Generated Data Access Layer Into Perspective

Do more with less code is the slogan of Visual Studio 2005.When it comes to reducing the amount of written code, wizards are definitely a viable option. Visual Studio 2005 has a lot of wizardry in it, especially to generate data access code. Any code that gets silently injected in your project follows a strict logic and a well-known design pattern. A full understanding how Visual Studio 2005 does it puts you on the right track to modify and extend the code to build your made-to-measure data access layer. This article dissects the code behind table adapters and binding source components to unveil patterns and best practices.

15 Jun 2006, 19:00:00   Source: Dissecting and Putting the Visual Studio 2005 Generated...   Tags: Database

Making Sense of the XML DataType in SQL Server 2005

In SQL Server 2005, XML becomes a first-class data type. Developers can make minor remote modifications to stored XML documents easily, taking advantage of new support for XML schema-based strong typing, and server-based XML data validation.
13 Jun 2006, 11:44:50   Source: Making Sense of the XML DataType in SQL Server 2005   Tags: Database XML

System.Transactions and ADO.NET 2.0

If you use DataAdapters and love their automatic connection-opening and closing capabilities—and ever use transactions, you should first understand what's really going on underneath the covers.
10 Jun 2006, 21:56:55   Source: System.Transactions and ADO.NET 2.0   Tags: Database

Security in the CLR World Inside SQL Server

Is running .NET Framework code within SQL Server 2005 exciting or a threat? Which is it? This article explores the security issues of SQLCLR code so that both developers and DBAs can make informed decisions about its use.
22 May 2006, 14:10:06   Source: Security in the CLR World Inside SQL Server   Tags: Database Security

User Tip: Receiving an Email When Database Data is Changed

For low-volume databases, those that are predominantly read and not written to, or database tables that are designed to not be updated or only updated under rare circumstances, a DBA or developer may be interested in being notified whenever the data in a particular table is modified. Or you may have certain records in a table that are assigned to a particular user and, upon that record being updated, that user should be notified of the change. While this sort of logic can be implemented at the code level, Microsoft SQL Server has all of the technologies needed to achieve this aim built directly into it. Triggers can be used to perform some action when data is inserted, updated, or deleted from a table, and Microsoft SQL Server's xp_sendmail extended stored procedure can be invoked to send an email to one or more recipients. Combining triggers with xp_sendmail provides a means for alerting specified users via email when the data in a particular table is modified...

16 May 2006, 19:00:00   Source: User Tip: Receiving an Email When Database Data is Changed   Tags: Database

Create Reports from Any Data Source Using SQL Server Reporting Services Custom Data Extensions

SQL Server Reporting Services makes it easy to build reports from database data, but what if the data isn't in a database? This article shows you how to take advantage of Reporting Services' unique extensibility model to build reports from ADO.NET datasets.
25 Apr 2006, 19:04:21   Source: Create Reports from Any Data Source Using SQL Server...   Tags: Database

System.Transactions and ADO.NET 2.0

Data is the blood in your system; it sits in its comfortable home of a database, and camps out in the tent of XML, but it deserves to be worked with in a reliable and consistent manner.But why should only data-related operations be reliable? Shouldn't you want to write reliable code for your other operations? The introduction of System.Transactions in .NET 2.0 brings a paradigm shift of how you will write reliable transactional code on the Windows platform. This article dives deep in the depths of how System.Transactions works, and how you can use it to your advantage. You will also see how you can leverage existing System.Transactions integration within ADO.NET, and why you need to really understand what is under the magic carpet.
20 Apr 2006, 19:00:00   Source: System.Transactions and ADO.NET 2.0   Tags: Database