My procedure is:
CREATE PROCEDURE [dbo].[sp_SavePost]
@PostTitle NVARCHAR(max),
@PostDescription NVARCHAR(max),
@PostDate DATETIME,
@Author NVARCHAR(100),
@Tag NVARCHAR(250), --it bring c#,asp.net,mvc
@Category NVARCHAR(250)
AS
BEGIN
INSERT INTO [dbo].[ForumPost](PostTitle, PostDescription, PostDate,
Author, Tag, Category)
VALUES(@PostTitle, @PostDescription, @PostDate,
@Author, @Tag, @Category)
END
Table [dbo].[ForumPost]
has postid
which is auto increment. There is another tables called Tag
. In a same procedure I want to insert a value into Tag
table which has column postid
and tag
. But unable to insert a value in tag
table. Means if postid=2
I want a result like this.
Table tag
postid | tag
------------
2 | c#
2 | asp.net
2 | mvc
Thanks.