代码改变世界

CAST, and, CONVERT, (Transact-SQL)

2008-07-01 12:43  Virus-BeautyCode  阅读(463)  评论(0编辑  收藏  举报

Updated: 17 July 2006

Explicitly converts an expression of one data type to another. CAST and CONVERT provide similar functionality.

Topic link icon Transact-SQL Syntax Conventions

Syntax for CAST:
CAST ( expression AS data_type [ (length ) ])

Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )