/****** Script for SelectTopNRows command from SSMS ******/ SELECT D_ID,[D_Name] as Name FROM [LFBMP.LDS].[dbo].[LDS.Dictionary] Where '32,33,34,35' like '%'+convert(nvarchar(10),D_ID)+'%' FOR XML PATH SELECT [D_Name]+',' FROM [LFBMP.LDS].[dbo].[LDS.…
DECLARE @hdoc int DECLARE @doc xml SET @doc ='<CityValueSet> <CityItem> <CityId>201</CityId><CityName>北京</CityName><EngName>beijing</EngName><Level>1</Level><ParentId>2</ParentId><…
准备工作: CREATE TABLE [dbo].[Students]( [id] [int] IDENTITY(1,1) NOT NULL, [names] [varchar](50) NULL, [hobby] [varchar](50) NULL ) insert into students values('张三','书法'),('张三','篮球'),('张三','台球'),('李四','书法'),('李四','唱歌'),('李四','足球'),('李四','乒乓球') for xml p…
function xmlToString(xmlData) { var xmlString; //IE if (window.ActiveXObject){ xmlString = xmlData.xml; } // code for Mozilla, Firefox, Opera, etc. else{ xmlString = (new XMLSerializer()).serializeToString(xmlData); } return xmlString; }…
MSSQL替换语句:update 表名 set 字段名=replace(cast(字段名 as varchar(8000)),'abc.com','123.com')例如:update PE_Article set Content=replace(cast(Content as varchar(8000)),'http://news.163.com/','http://edu.cnzz.cc/')其中PE_Article 为表名 Content为字段名 http://news.163.com/…
字符串分割后的值,把表中不存在的插入表中 --供大家参考 使用场景,自行思考…… --创建表tb1 Create table tb1 ( cola int, colb ) ) --插入数据 insert into tb1(cola,colb) , 'A' union all , 'B' union all , 'C'; --存储过程 Create proc sp_tbTest @sid int,--ID )--A,B,C,D,G AS BEGIN insert into tb1(cola,col…