if exists(select * from sysobjects where name = 'strToTable')
drop proc strToTable
go
CREATE proc dbo.strToTable
@gidstr nvarchar(4000) --商品id
as
declare @xmlstr xml
set arithabort on
set @xmlstr=convert(xml,'<root><v>' + replace(@gidstr, ',', '</v><v>') + '</v></root>')
select gid = N.v.value('.', 'int')
into #tmp
FROM @Xmlstr.nodes('/root/v') N(v)
select * from #tmp