|
|
Archive of Entries
|
 |
|
|
|
 |
|
|
late nite coding
|
 |
|
Location: Blogs The Woolston Blog |
 |
| Posted by: daniel |
6/8/2005 4:00 PM |
spent the better part of my evening coming to the realization that i dont have delete functionality on a row by row basic for the tags. aw crap. thats gonna mean about 9 more stored procs and i'm gonna have to change the interface to the tag class again. crapola. spent a good chuck of the nite writing this: Select @sqlscript = 'SELECT Distinct Top ' + Convert(varchar(5),@Limit) + ' o.[TagID], t.[TagName], (select max(TaggedOn) From [dbo].[taggedobject] m where m.TagID = t.TagID) as [DateLastUsed], (select count(*) from taggedobject s where o.TagID = s.TagID and o.ObjectType = ' + '''' + @ObjectType + '''' + ' and s.ObjectID = ' + convert(varchar(20), @ObjectID) + ') as [Count], t.Created, t.LastUpdated, (Select 1 Where ' + convert(varchar(20), @MemberID) + ' in (Select s.MemberID From TaggedObject s Where s.TagID = o.TagID And o.ObjectType = ' + '''' + @ObjectType + '''' + ' and s.ObjectID = ' + convert(varchar(20), @ObjectID) + ')) As [MemberHasTag] From [dbo].[TaggedObject] o Join [dbo].[Tag] t on t.TagID = o.TagID Where o.[ObjectID] = ' + convert(varchar(20), @ObjectID) + ' and o.ObjectType = ' + '''' + @ObjectType + '''' + ' and t.[TagName] > ' + '''' + @LastTagName + '''' + ' Order by t.[TagName]'
aint it purty. man i love subselects. working on non microsoft projects has nearly corrupted me, but i think i'm coming back now. |
|
| Permalink |
Trackback |
|
|
|
|
Search_Blog
|
 |
|
|
|
 |