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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cursor or Not

Author  Topic 

sp_wiz
Yak Posting Veteran

55 Posts

Posted - 2001-10-21 : 13:04:13
I have 2 tables 1 called PHOTOS the Other Keywords.

Each row in photos can have many rows in keywords.

How do I display a recordset with the Photo table details with the related keywords.

I really need to get the keywords into a delimitted string

Example
PhotoID, title , Keywords
1,My photo , family,children,kids
2, Wedding, bridesmaid,nightmare

Does this make sense

I realise if i only wanted to display 1 record for photos this would be fairly simple.

Robp


urobertson
Starting Member

9 Posts

Posted - 2003-10-30 : 14:52:13
Just to add one thing. I used this code and it works great providing I change one thing...


--Build your csv string of keywords
Select @keywords = null


Should be

--Build your csv string of keywords
Select @keywords = ''


And similar for other examples.
Because you can't concatenate to a null. It stays null. (At least it does in my code, W2K, SS 2000)

Thanks for the great code. I really appreciate it.

Thanks,
Ursula
Go to Top of Page
   

- Advertisement -