Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I have emp_code value from sp in set of records.i want to insert into emp_master tableplease help me with query...INSERT INTO emp_master( emp_code, location_id,gender_id) Values ( select * from dbo.split('1234580237,1234580238,1234580239,1234580240',',') , 3 , 1)THANKSSHANMUGARAJnshanmugaraj@gmail.com
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-04-24 : 09:06:07
Should be more like this:
INSERT INTO emp_master( emp_code, location_id,gender_id) select ColName,3,1 from dbo.split('1234580237,1234580238,1234580239,1234580240',',')
The red ColName is the name of the column that your split function returns. You could try using *,3,1 instead of ColName,3,1 if split function returns only one column.