Search
January 07, 2009   |  Login  |  
 Archive of Entries Minimize

 Print   
 late nite coding Minimize
Location: BlogsThe 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

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search_Blog Minimize

 Print   
You are here: - Blogs
Copyright 2005 Dan Woolston
www.danwoolston.com
Terms Of Use
Privacy Statement