Link to home
Start Free TrialLog in
Avatar of attipa
attipaFlag for United States of America

asked on

sql: insert into table multiple items

I want to create a stored procedure where it does this:

1. a select statement picks up UserIP column from Comments (there could be 1, there could be 100)
2. take each of those UserIP's and insert into a table called NEWIP
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A Stored Procedure is quite simple:
CREATE PROCEDURE usp_AddUserIPs

AS

SET NOCOUNT ON

INSERT  NEWIP (UserIP)
SELECT  UserIP
FROM	Comments

Open in new window