sqlserver2008中的cast和convert:
将某种数据类型的表达式显式转换为另一种数据类型。
CAST 和 CONVERT 提供相似的功能。
语法:
使用 CAST:CAST ( expression AS data_type )
使用 CONVERT:CONVERT (data_type[(length)], expression [, style])
实例:
@intType int
cast(@intType as nvarchar(100))
convert(nvarchar(100),@intType)