SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alias Data Type
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mmkrishna1919
Yak Posting Veteran

India
94 Posts

Posted - 04/26/2013 :  01:11:28  Show Profile  Reply with Quote
Hi All,

while i was reading about AVG function i came across below statement

"However, if the base data type of the alias data type is promoted, for example from tinyint to int, the return value is of the promoted data type and not the alias data type."

Link: <<http://msdn.microsoft.com/en-us/library/ms177677.aspx>>

Here how can we promote base data type from tinyint to int?

Thanks,
M.MURALI kRISHNA

Edited by - mmkrishna1919 on 04/26/2013 01:12:07

chadmat
The Chadinator

USA
1974 Posts

Posted - 04/26/2013 :  01:32:57  Show Profile  Visit chadmat's Homepage  Reply with Quote
It happens implicitly as per the table in the link you posted (just above the quoted comment.

-Chad
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/26/2013 :  01:36:05  Show Profile  Reply with Quote
tinyint to int happens automatically.
however in cases like int to decimal etc you've to do it using explicit or implicit conversion.





------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

mmkrishna1919
Yak Posting Veteran

India
94 Posts

Posted - 04/26/2013 :  01:51:02  Show Profile  Reply with Quote
Chad/visakh Thanks for reply.





M.MURALI kRISHNA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/26/2013 :  01:57:32  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000