当使用:SELECT ','+Id FROM dbo.Test FOR XML PATH('')); //这样读取的数据虽然是1,2,3,4,但是仍然是xml格式,所以当数据超过2033时候,用sqldatereader或者sqldateadapter读取数据会截断xml文件. 此时要:SELECT STUFF((SELECT ','+Id FROM dbo.Test FOR XML PATH('')),1,1,'');//利用stuff函数将xml文件转换为一个字符串字段.就不会截断.
--将行转为字符串 select stuff((select top 20 ','+ QQ from dl_QQ where uiid=1 order by tim desc for xml path('')),1,1,'') -- ============================================= -- Description: 将字符串转为表格 /* 例:select * from [f_split]('spu0987*5//spu0988*5/spu0989*5',
以前js拼接字符串有好多 \n \t 不使用ES6 使用"\n\t"将多行字符串拼接起来: var roadPoem = 'Then took the other, as just as fair,\n\t' + 'And having perhaps the better claim\n\t' + 'Because it was grassy and wanted wear,\n\t' + 'Though as for that the passing there\n\t' + 'H
目的 编写一个基于字符串拼接的js模板引擎雏形,这里并不会提供任何模板与数据的绑定. 基本原理 Javascript中创建函数的方式有多种,包括: 1. var func = function () {...} 2. function func () {...} 3. var func = new Function (...); 其中new Function的方法给到了我们很大的自由度,比如: var func = new Function('a', 'b', 'return a+b;'); f