Aug 06, 2009 04:48 AM|Nimol|LINK
Hi my buddy,
Now i'm having problem with Insert SQL Statement where shown as code below
declare @sql varchar(250), @sl varchar(30),@groups varchar(30)
set @sl='5,6,7',set @groups='test'
set @sql= '
insert into tbl_CustomerMasterGroups (CustomerID,MasterGroupCode)
Values(select CustomerID from Tbl_Customers where CustomerID in ('+@sl+'),+'@groups'+)'
Problems : with kind of my code above it will show errors so can you tell me how can i insert into one table where one colum from select statement and one column from other variable
Thanks in advance!