Declare @APS nvarchar(1000)='1,1,1.79103540163304,1.79103540163304'
,@cluster nvarchar(1000)='0150,0019,0150,0019'
,@style nvarchar(1000)='696707-018,696707-018,696707-017,696707-017'
CREATE TABLE #temptable (
ID int IDENTITY (1, 1) NOT NULL ,
stylecolor varchar (500) NOT NULL ,
APSDev varchar (250) NULL,
ClusterID varchar(1000) Null
)
Here I would like to insert
insert into #temptable (stylecolor, ClusterID, APSDev)
select item from [<table name>]. dbo.SplitString(@style,',')
select item from [<table name>].dbo.SplitString(@cluster,',')
select item from [<table name>]. dbo.SplitString(@APS,',')
Getting error:
The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.
Output Result: should be looks like this
stylecolor clusterID APSDev
696707-018 0150 1
696707-018 0019 1
696707-017 0150 1.79103540163304
696707-017 0019 1.79103540163304