It's actually a tight keyword system with a single table containing
all of the unique keywords which is joined to whatever other table is
needed. I want to get the keyword id for a particular keyword and
insert it if needed. I think this will do it based on this post and
DKs.

create procedure getkeywordid @keyword varchar(100)
as
SET NOCOUNT ON;

select keywordid
from keyword
where keyword = @keyword

if @@ROWCOUNT =1
insert into keywords (keyword)
values (@keyword)

select maxid = @@identity

SET NOCOUNT OFF;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3325
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/sql/unsubscribe.cfm

Reply via email to