Home >Database >Mysql Tutorial >sql数字转换string字符型

sql数字转换string字符型

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:49:001901browse

由于sql中没有像vb一样的cstr或php中的string来强制转换,我们自定了一个函数。

 代码如下 复制代码

CREATE FUNCTION [dbo].[Cstr]
(
    @Value SQL_VARIANT
 )
RETURNS NVARCHAR(MAX)
AS
BEGIN
    RETURN ISNULL(CAST(@Value AS NVARCHAR(MAX)), '')
END

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn