February 28, 2006 at 12:49 am
Hi,
I would like to avoid to user sql cursor for insert data from table to table
I created this store procedure :
CREATE
PROCEDURE [contact].[importContactClient]
@userid int, @id uniqueidentifier AS
INSERT
contactClient SELECT @userid, name, phoneNumber, adresse FROM contactSupplier WHERE contactID = @id
GO
But I have this error : Must declare the scalar variable "@userID".
degrem_m
Degremont
February 28, 2006 at 2:11 am
You've put a variable in line 3, where you want a column name.
February 28, 2006 at 3:35 am
Basically, the procedure is OK. But how about some parentheses around it's parameters?
CREATE PROCEDURE [contact].[importContactClient]
(@userID int, @id uniqueidentifier) AS ...
_/_/_/ paramind _/_/_/
February 28, 2006 at 5:28 am
When I add parentheses, it's the same error.
@userid is variable. This value must be inserted foreach rows.
CREATE PROCEDURE [contact].[importContactClient]
(@userID int, @id uniqueidentifier AS)
INSERT contactClient SELECT @userid, name, phoneNumber, adresse FROM contactSupplier WHERE contactID = @id
GO
degrem_m
Degremont
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply