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.
| Author |
Topic |
|
sp_wiz
Yak Posting Veteran
55 Posts |
Posted - 2001-06-30 : 15:32:34
|
| Please can some one suggest a better way of achieving this..I have 2 tables 1 is a products table and the other contains a list of product makes.The product table holds a comma delimited string with the id's of the makes table ie '1,2,3'Which in the makes table is 1 = sony2 = phillips3 = what everObviously i want to display the makes names that cover that product detailsThe sp i am using works but i'm sure there must be a better solution.BEGINdeclare @make varchar(50)select @make = make from diy_products where product_id = @product_iddeclare @cmd varchar(300)declare 'make_names varchar(200)set @cmd = 'select @make_names = make from diy_makes where id in ('+@make+')'Select *,@make_names from diy-products where product_id = @productIDENDRobp |
|
|
|
|
|