February 23, 2007 03:23 PM

Automate Date/Time Conversions

This extensible, flexible, data-driven utility can handle all your date-formatting needs
Rating: (0)
SQL Server Magazine
InstantDoc ID #94954
SQL Server offers two native data types for storing date and time data: datetime and smalldatetime. Both store the date and time together, with datetime offering more range and precision than smalldatetime. Table 1, compares these two data types.

Because SQL Server stores date and time information together, working with date and time data—even with the help of built-in T-SQL conversion functions—is challenging. Storing date and time information in the same column means you have to parse the date information if you want to separate it into individual elements for data input, date math, or data retrieval.

T-SQL ...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

Setting ansi_nulls off may cause some errors for those using 2005. When the ansi_nulls is not specified, by default, the compiler will compile this with Ansi_nulls ON. As your code doesn't care whether it is on or off (ie no "if @var=null" statement exists), I'm curious as to why you specify it as off.

JAMES5/14/2007 12:39:08 PM


This is definitely useful and I will use this.

GARY3/4/2007 10:31:10 PM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS