October 28, 2011 at 4:13 am
Regards
November 3, 2011 at 3:37 pm
Well, you are missing the '@' for email parameter for the second insert.
And I am not sure why @emailtable is defined in the procedure and you are using "select @emailaddress from emailtable". Did you want to elaborate?
It seems to me you would just want to insert a single email address into two separate tables. If so, you would use the following:
create procedure RS(@emailtable as nvarchar(255))
as
set nocount on
begin
insert into tri1(email)
values (@emailaddress)
insert into tri2(email)
values (@emailaddress)
go
exec RS 'myemail@gmail.com'
November 4, 2011 at 5:59 am
nicko5 (11/3/2011)
It seems to me you would just want to insert a single email address into two separate tables. If so, you would use the following:create procedure RS(@emailtable as nvarchar(255))
as
set nocount on
begin
insert into tri1(email)
values (@emailaddress)
insert into tri2(email)
values (@emailaddress)
go
exec RS 'myemail@gmail.com'
That would not work becqause you have called the parameter @emailtable in the proc header but used @emailaddress in the proc body.
Tom
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply