I've got this stored procedure, and I know it is wrong, but am not sure how to make it right.
CREATE PROCEDURE [dbo].[sp_CreateNewConnection]
(
@UserID int = NULL,
@FriendID varchar = NULL
)
AS
INSERT INTO CONNECTIONS (userid, friendid)
values (@UserID, (select id from users where username = @FriendUserName))
Can anyone show me how to do what I'm really trying to do here?
Much thanks
Cen
CREATE PROCEDURE [dbo].[sp_CreateNewConnection]
(
@UserID int = NULL,
@FriendID varchar = NULL
)
AS
INSERT INTO CONNECTIONS (userid, friendid)
values (@UserID, (select id from users where username = @FriendUserName))
Can anyone show me how to do what I'm really trying to do here?
Much thanks
Cen