TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sanjay Kumar
NA
5k
4.4m
CREATE PROCEDURE
Oct 14 2013 6:34 AM
If Row Exists, Update, Else Insert in Asp .net
fields :
StudentID, FirstName, LastName
and
Status
CREATE
PROCEDURE
ExistsUpdateInsert
(
@StudentID
int
,
@FirstName
[nvarchar]
(
50
),
@LastName
[nvarchar]
(
50
),
@Status
[nvarchar]
(
50
)
)
AS
BEGIN
IF
EXISTS
(
SELECT
StudentID
FROM
StudentTable
WHERE
StudentID
=
@StudentID
)
UPDATE
StudentTable set
StudentID
=
@StudentID
WHERE
Status
=
'Active'
ELSE
INSERT
INTO
StudentTable
(
StudentID
,
FirstName
,
LastName
)
VALUES
(
@StudentID
,
@FirstName
,
@LastName
)
END
END
please help code
Reply
Answers (
5
)
Pass value instead of id in Gridview column in C#
Pdf parser Image extraction from pdf