Member of the LearnItFirst.com Video Training Network Related Video Training Sites: · SQL Server DBA Tutorials · Integration Services Training
   
Transact-SQL Programming and Query Writing
                        Training Videos

Transact-SQL Programming and Query Writing Tutorial: 02 - Implicit Datatype Conversion and How SQL Server Converts Data in Expressions

   Chapter: Table Design - Datatypes, Constraints, IDENTITY Columns, Normalization, and More
Download! Skill Level: 200 (Beginner - Intermediate)
Duration: 11:00
Size: 9.17MB
Versions/Editions Covered: SQL Server 2005 , SQL Server 2008 , SQL Server 2000
Added/Updated: Feb 20, 2007
Staff Pick!
Download this video
This video is all about how SQL Server can automatically (implicitly) convert datatypes in expressions. For example, in the expression 'SELECT 1 + 10000 + 0.00', what will the return datatype be? 1 could be a BIT, a TINYINT, a SMALLINT, an INT, or a BIGINT - which is it? 10000 could be a SMALLINT, INT or BIGINT. 0.00 could be a DECIMAL, NUMERIC, FLOAT, REAL, MONEY, or SMALLMONEY.

Highlights from this video:
  • In the expression, SELECT '123', is '123' a string or a number?
  • In the expression, SELECT 2007/08/08, is the return type an INT, a DECIMAL, or a DATETIME?
an much more on datatypes


So what is the answer to our question above? The answer is that if you just typed that expression in, your return type would be a FLOAT.
Tags for this video: cast cast and convert convert data type conversion decimal float int32 int64 numeric nvarchar(max) real varchar(max)  
< Back Download this video
AddThis Social Bookmark Button
People Who Downloaded this Video Also Downloaded:
TitleSkillDownload
Subqueries, Nested Queries, and Derived Tables - An Introduction to Advanced SQL... 300 Download
Constraint Keys, Index Keys, Composite Keys, Natural keys, and Surrogate Keys 200 Download
When to Use HAVING Instead of WHERE - Aggregates, GROUP BY, and the HAVING Claus... 300 Download
Query Analyzer - Beyond the Basics (SQL Server 2000) 200 Download
JOINs - An Overview of the Five Types of JOINs (Cross, Outer, and Inner) 200 Download
This video is part of the following video series: "Data Type Overview - Order of Precendence, Using CAST and CONVERT, and Best Practices for Data Type Conversion"
All SQL developers should have command of the datatype conversion functions, CAST and CONVERT. All SQL developers should also have full knowledge of the data types themselves (i.e., which holds a larger number, FLOAT or REAL?).

This video series helps you cope with the various data types as well as helping you learn how implicit and explicit datatype conversion works (i.e., converting from a string to a number) and much, much more.
To view all videos in this series, click here

About the Instructor:

Scott Whigham Scott Whigham is the founder of LearnItFirst.com, one of the web's most extensive video training libraries focusing on technical training. Scott is also an experienced consultant, trainer, and author with more than a decade of hands-on experience working with SQL Server databases, writing and debugging applications using Visual Studio, and performance tuning. Scott designed the architecture (websites, class libraries, and database) for the LearnItFirst.com websites and, most re... (Scott Whigham's full bio can be found on the About the Author page)

   
 
About Us Video Playback Subscriptions More Video Training More
 
© Copyright 2004-2008 LearnItFirst.com LLC. All rights reserved. All trademarks remain the property of their respective owners. This site is not affiliated in any way with the Microsoft Corporation. Refer a Friend and Get a Free Subscription!
 
1/6/2009 2:41:07 PM