Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Difference between CAST, CONVERT, and PARSE function in Microsoft SQL Server

Though all three, CAST, Convert and PARSE are used to convert one data type into another in SQL Server, there are some subtle differences between them.The  CAST method accepts just two parameters, expression, and target type, but CONVERT() also takes a third parameter representing the format of conversion, which is supported for some conversions, like between character strings and date time values. For example, CONVERT(DATE, '2/7/2015', 101) converts the character string '2/7/2015' to DATE using DATE format 101, representing United States standard. By using the PARSE function, you can also indicate the culture by using any culture supported by the Microsoft's  dot NET framework. For example, PARSE('7/8/2015' AS DATE USING 'en-US') parse the input literal as a DATE by using a United State English Culture, similar to 101 formatting style.
Read more »


This post first appeared on Javarevisited: Blog About Java Programmin, please read the originial post: here

Share the post

Difference between CAST, CONVERT, and PARSE function in Microsoft SQL Server

×

Subscribe to Javarevisited: Blog About Java Programmin

Get updates delivered right to your inbox!

Thank you for your subscription

×