Both cast and covert serves the same purpose i.e. convert a data type to another.
- Cast
- Cast is ANSII Standard
- Cast cannot be used for Formatting Purposes.
- Cast cannot convert a datetime to specific format
- Convert
- Convert is Specific to SQL SERVER
- Convert can be used for Formatting Purposes.For example Select convert (varchar, datetime, 101)
- Convert can be used to convert a datetime to specific format
Appu
14 years agoSir ,thanks for your information on your website..Please i want to ask one question about how to store multiple languages like english,hindi and kannada in sql server database…
Achu
14 years agoUse nvarchar…….
All the best
Achu
14 years agoWOW WONDERFUL>>>>>>>>>>>>……………
Akshara
14 years agoWhen you cast a number to real of size -1.18E-39 you expect an conversion error, so removing a zero should be OK. You have to remove zero’s until -1.18E-36 before the error is not thrown.
Using convert you can use up to -1.18E-38 before the number is changed into a 0 (zero)
Pnamito
14 years agoLOLOLOLOLOL
Dbcc Commands In Sql Server |
14 years ago[…] SQL SERVER – DIFFERENCE BETWEEN … – Both cast and covert serves the same purpose i.e. convert a data type to another.# Convert is Specific to SQL SERVER.Convert can be used for Formatting […]