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 |
evanburen
Posting Yak Master
167 Posts |
Posted - 2008-01-03 : 09:46:36
|
I often have to delete a long list of records and given the CompID for each value which is an int value and the PK. I'm not sure how to do this as the only ways I know how aren't working. Could someone give me some pointers? Thanks CREATE PROCEDURE [dbo].[sp_DeleteRetiredCompanies]@CompID IntASDELETE FROM TCompanies WHERE CompID IN (@CompID)DELETE FROM TCompanyProfiles WHERE CompID IN (@CompID)DELETE FROM TCEOComp WHERE CompID IN (@CompID)DELETE FROM Relationships WHERE CompID IN (@CompID)GOexec sp_DeleteRetiredCompanies '12931,12845,14551' error - interprets compID values as stringsexec sp_DeleteRetiredCompanies 12931,12845,14551 error - too many arguments specified |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-03 : 09:52:44
|
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htmMadhivananFailing to plan is Planning to fail |
 |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2008-01-03 : 10:08:41
|
Very helpful - Thanks a lot. |
 |
|
|
|
|