Mar 30, 2019 I have a Transact-SQL query that uses the IN operator. Something like this: select. from myTable where myColumn in (1,2,3,4) Is there a way to define a variable to hold the entire list '(1,2,3,4.
Hi,i am getting the below string in @sql variableselect '+EmployeeID+'+EmployeeName+'+Week5+'+Week6+' from ##tsmailerNow when i execute by Exec(@sql)0015 Giri Venkata Ramana Reddy Pulikallu 0082 Raghu Ponnani Ganeshan Pending Approval 0129 Nageswara Rao Attimahanthi 0474 Surender Kasturi Disapprove Disapprove 0155 Seeta Rama Anjaneyulu Mereti 1285 Debashish Das Pending Approval i want the above executed HTML data in a string variable after executing like EXEC(@sql).Now i need to capture the output and append to another string so that i can prepare body of the mail and mail it.Pls. Help me the ways to get the output to string variable.Thanks,Rajesh.