Link to home
Start Free TrialLog in
Avatar of kishore_peddi
kishore_peddi

asked on

What is the difference between CAST and CONVERT in SQL-Server 2000 ?


Hi,

Please let me know what is the difference between CAST and CONVERT in SQL-Server 2000 ?

Thanks,
Kishore
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

CAST() can only change from one datatype to another.

CONVERT() can do editing/manipulation of the results.  For example, formatting a date in a particular way.

CAST() is ANSI-standard; CONVERT() is a MS extension.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi kishore_peddi!

Actually, CAST and CONVERT provide similar functionality.

For your reference regarding this matter, visit this site : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_2f3o.asp

Hope this makes sense.


Regards!
eNTRANCE2002 :-)