Blog

T-SQL Programmability Features in SQL server 2008 - Part 2

The previous versions of SQL Server had two date/time data types DATETIME and SMALLDATETIME. Both of them stored a DATE value and a TIME value together. SQL Server 2008 introduces four new date and time data types.

By Admin

Introduction to LINQ

Language Integrated Query (LINQ) is a Microsoft .Net Framework component which adds native date querying capabilities to .Net languages. LINQ unifies the way data can be retrieved in .Net, from any object which implements the IEnumerable interface.

By Admin

Temp Table or Table Variable - Which Should You Use?

While writing stored procedures it is often needed to store data temporarily in one place and perform some manipulations on it so that the expected output can be acquired. For example, when the result set of a complex query pulling data from one or more database tables, we need a table-like object to store them in order to reuse it wherever we need it. Microsoft SQL server has provided two kinds of database objects to store data temporarily. They are temporary tables and table variables.

By Admin

Procedure for Searching Text in Database Tables

I had come across a requirement to search a string in all columns of all tables of a database with several varchar columns each, looking for various string data. I had to find a stored procedure to search text through all tables. It snakes through the schema of your selected database looking for all chars, varchars, nchars, and nvarchars (Text datatype has been eliminated for performance) looking for my string. It returns the name of the table and column, and the containing text block. I ran it on our staging system and it found my string in about 30 seconds... not too shabby.

By Admin

Date Handling with SQL Server

The date range for a DATETIME column can be January 1, 1753 to December 31, 9999. SQL Server uses 8 bytes to store the DATETIME data type. The first 4 bytes make up an integer value that represents the number of days since January 1, 1753. The second 4 bytes are an integer value that represents the number of milliseconds since midnight.

By Admin