arthrex
asked on
SELECT @newLinkId = Link_Id FROM inserted what to use for "inserted"?
hello experts,
the line "SELECT @newLinkId = Link_Id FROM inserted" is wrong.
Please tell me what to use instead of inserted.
Thanks a lot!
CREATE PROCEDURE [dbo].[Linksummary_CreateN ewLink]
@Linkname nvarchar(50),
@Linkdescr nvarchar(100),
@Linkurl nvarchar(500),
@CategoryId int
AS
INSERT Link
(
Link_Name,
Link_Descr,
Link_Url
)
VALUES
(
@Linkname,
@Linkdescr,
@Linkurl
)
DECLARE @newLinkId int
SELECT @newLinkId = Link_Id FROM inserted
INSERT Category_Link
(
Category_Id,
Link_Id
)
VALUES
(
@CategoryId,
@newLinkId
)
RETURN @@IDENTITY
the line "SELECT @newLinkId = Link_Id FROM inserted" is wrong.
Please tell me what to use instead of inserted.
Thanks a lot!
CREATE PROCEDURE [dbo].[Linksummary_CreateN
@Linkname nvarchar(50),
@Linkdescr nvarchar(100),
@Linkurl nvarchar(500),
@CategoryId int
AS
INSERT Link
(
Link_Name,
Link_Descr,
Link_Url
)
VALUES
(
@Linkname,
@Linkdescr,
@Linkurl
)
DECLARE @newLinkId int
SELECT @newLinkId = Link_Id FROM inserted
INSERT Category_Link
(
Category_Id,
Link_Id
)
VALUES
(
@CategoryId,
@newLinkId
)
RETURN @@IDENTITY
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! @@identity worked... too easy to imagine..