SQLSERVER的dbo.fnSplit插入多条数据

	--插入新数据
	INSERT  INTO table
        ( AdMachineImgRelactionId ,
          AdMachineImgId ,
          AdMachineId ,
          IsDeleted
        )
        SELECT  NEWID() AS AdMachineImgRelactionId ,--生成新GUID
                '666' AS AdMachineImgId ,--666为数据
                Item AS AdMachineId ,
                0 AS IsDeleted
        FROM    dbo.fnSplit('1,2,3,',',');--字符串以“,”分割,形成数组对象

  当然,初始的也有循环多条插入

 

posted @ 2017-03-16 10:46  蜗牛的礼物  阅读(180)  评论(0编辑  收藏  举报