Create a comma delimited list of Categories selected for an Event - you will get an Array of results for the checkboxes from the web form, so its pretty easy to express that as a delimited list.Then using SQL Split the comma delimited list and join the result against the Event, resulting in one row per Event/Category combination.Then use that to adjust the EventCategory table.So something like this:INSERT INTO jEVENTSCATEGORIES(MyEventColumn, MyCategoryColumn)SELECT 1234, -- The event number SplitValue -- The value from the Category list delivered by the Split FunctionFROM MySplitFunction('1,2,3,4,5') -- The category listIf you are updating an existing event you might pre-delete the old category choices:BEGIN TRANSACTIONDECLARE @intError intSET @intError = 0DELETE DFROM jEVENTSCATEGORIES AS DWHERE MyEventColumn = 1234IF @@ERROR = 0 SET @intError = 1INSERT INTO jEVENTSCATEGORIES ...SELECT ...FROM MySplitFunction(...)IF @@ERROR = 0 SET @intError = 2IF @intError = 0BEGIN COMMITENDELSEBEGIN ROLLBACKEND
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Best%20split%20functionsKristen