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.
| Author |
Topic |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2007-11-06 : 09:21:46
|
| How do I write a stored procedure for this? delete from titleclassification where titleID='933'INSERT INTO titleclassification (classificationid, titleid)VALUES ('7','933');INSERT INTO titleclassification (classificationid, titleid)VALUES ('8','933');INSERT INTO titleclassification (classificationid, titleid)VALUES ('9','933');INSERT INTO titleclassification (classificationid, titleid)VALUES ('10','933');INSERT INTO titleclassification (classificationid, titleid)VALUES ('11','933'); |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-06 : 09:43:43
|
can you explain what do you want to achieve ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2007-11-06 : 09:57:11
|
| I want the title id to be deleted first then have that same selected ID to go into the database with the values of the check box items selected(classificationid). So multiple entries should go into the database for titleid='933'. I hope that make sense.This is my attempt but it's not working:@titleID int,@classificationID intASBegindelete from titleclassification where titleID=@titleid insert into titleclassification(classificationID, TitleID)values (@classificationID, @Titleid )end |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2007-11-06 : 10:30:56
|
| Got the answer I needed to add delete from titleclassification where titleid = @titleid and classificationid = @classificationid |
 |
|
|
|
|
|
|
|