Advanced SQL Server DATE and DATETIME Handling
There are lot of situations where you need an exact timestamp. For example, you may want to differentiate a recordsets creation dates, store technical measurements, or just to see how fast your latest SQL is running. Coding the 4th dimension is another common task, and therefore milliseconds are essential.
Changing the SQL Server Century Cut-Off Date
The work undertaken to resolve the year 2000 problem taught developers that they should be using four-digit dates. However, as integration with legacy systems is still required, so are two-digit dates. SQL Server provides a century cut-off point to help.
Counting Parents and Children with Count Distinct
The aggregate functions in SQL Server (min, max, sum, count, average, etc.) are great tools for reporting and business analysis. But sometimes, you need to tweak them just a little bit to get exactly the results you need. For example, if your manager came to you and asked for a report on how many sales have been made to your clients and how large they were, would you know how to get the data you need efficiently? Author ran into something like this recently and here's the approach he took to solve the problem.
Demystifying the SQL Server DATETIME Datatype. Part 1
When you follow online communities dedicated to SQL Server with open eyes, you certainly notice a whole lot of questions are closely related to the DATETIME datatype in one way or the other. Obviously, working with DATETIME not as easy as it may seem.
Exception Handling in SQL Server 2000 and Yukon
Error handling plays a vital role when writing stored procedures or scripts. In this article I will discuss error handling in SQL Server 2000 and SQL Server Yukon. Before starting the discussion of the error handling part, I will take you through the different components of an error message. Here is a typical error message you get when working with SQL Server 2000 Query Analyzer.
How to Find a SQL Server Database Object
A better why to find a SQL Server object, such as a table, a procedure, or a trigger, would be to query the sysobjects system table in the local database (of course, one has to be certain about which database that object is supposed be in).
HOWTO: Display Images Stored in a BLOB Field
Using Active Server Pages (ASP), you can view images stored in BLOB (Binary Large Object) fields in your Internet browser. This article provides information on how to display a GIF image stored in the Microsoft SQL Server sample database ...
Identifying Your New Records
While the use of AutoNumber and Identity fields in tables is greatly applauded by database designers the world over, they can be annoying for developers to use. This article reveals two techniques for retrieving the value of an AutoNumber/Identity field.
Implementing a Dynamic WHERE Clause
This article covers building a dynamic where clause. And the really neat part is that you don't actually need to write dynamic SQL. This is soooo much simpler.
Introduction to Dynamic SQL (Part 1)
Have you ever tried to run "Select * from @TableName"? This article shows you how to use Dynamic SQL inside SQL Server to build your SQL on the fly.
Introduction to Dynamic SQL (Part 2)
In a follow up to the Introduction to Dynamic SQL we take you through some of the tricks and pitfalls of this technique. We'll cover Create Table, sp_executesql, permissions, scope and more.
Managing Extended Properties
Use SQL Server 2000's sql_variant data type to add user-defined extended properties to your data, tables, columns, parameters, and other objects.
Performing Cascading Deletes with Triggers
Triggers are the best way to go to perform cascading deletes. Due to their proximity to the actual data, they are extremely efficient but also have a number of other advantages.
Views in SQL Server
A view is a virtual table that consists of columns from one or more tables. Though it is similar to a table, it is stored in the database. It is a query stored as an object. Hence, a view is an object that derives its data from one or more tables. These tables are referred to as base or underlying tables.
Network Magazine Provides information Technology (IT) and network managers with strategic analysis, views of emerging technologies and product reports....
subscribe now