Question : Stored Procedure Help Please

Hello Experts,

I'm using the SP below to insert records into two tables -

It works nicely on a line by line basis -

@ID relates to the site id of which there are 74 these being  IDs

1 - 20, 22 - 66, 68 - 72 & 74 -77

What I would really like to do is run the SP for each of these Ids when I click the execute button, rather than having to manually enter each ID,

Is this possible?

Many thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
USE [JobBoardRegion]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[1LargeClientInsert]
	@ID int
AS
SET NOCOUNT ON
    DECLARE @NewID INT;
    INSERT dbo.JBClient
  (
   JBCLSiteID,
   JBCLName,
   JBCLAddress,
   JBCLPhone,
   JBCLEmail,
   JBCLCompanyType,
   JBCLURL,
   JBCLAccountType,
   JBCLBillingContact,
   JBCLDescription,
   JBCLAccountLive,
   JBCLMStartDate,
   JBCLMEndDate,
   FreeTrial
  )
  SELECT
   @ID,
   'name',
   'address',
   'phone',
   '[email protected]', 
   'r',
   'http://www.website.co.uk',
   'm',
   'person',
   'company description',
   'Y',
   '2010-05-19 00:00:00.000',
   '2011-05-19 00:00:00.000',
   'Y';
  SET @NewID = SCOPE_IDENTITY();
  INSERT dbo.JBEmployee
  (
   JBEClientID,
   JBESiteID,
   JBEName,
   JBELevel,
   JBEUsername,
   JBEPassword,
   JBEPhone
  )
  SELECT
   @NewID,
   @ID,
   'person',
   'A',
   '[email protected]',
   'password',
   'phone';
GO

Answer : Stored Procedure Help Please

then use this where after the from

change
'from table_id'
for
Random Solutions  
 
programming4us programming4us