Home Forums Article Discussions Article Discussions by Author Discuss content posted by Suresh G. Kumar A simple T-SQL statement to create a list of lookup values RE: A simple T-SQL statement to create a list of lookup values
Mansfield
SSCrazy
Points: 2396
More actions
March 20, 2011 at 9:14 pm
#1301101
You can use the following SQL to compose the comma-delimited string, without needed to trim the trailing comma at the end:
SELECT @MyStatusList = ISNULL(@MyStatusList + ',', '') + StatusDesc FROM (SELECT DISTINCT StatusDesc FROM MyStatus) x