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
Amudhan Kuppan
NA
378
30.3k
Stored Procedure
Mar 23 2018 5:56 AM
hi
anyone clear my doubt
i will send one SP please check
My question is that query ID is an identity column
if ID is an identity column are how to find out?
my idea is go to table and right click of the table click design and click identity specification so now iam see ID part increment column is set to yes or not correct?
this is my idea
my colleague say please check script and tell me how to find ID is an identity column in see the script.......
use master
go
CREATE PROCEDURE dbo.MergeDataType
@ID
int
= NOTNULL,
@Name nvarchar(255),
@Address nvarchar(255)
AS
BEGIN
SET NOCOUNT ON;
WITH [source](ID, Name, [Address]) AS
(
SELECT @ID, @Name, @Address
)
MERGE dbo.student AS T
USING dbo.student
as
S ON T.ID = S.ID
WHEN MATCHED THEN
UPDATE SET T.Name = @Name,
T.Address = @Address
WHEN NOT MATCHED THEN
INSERT (Name, Address)
VALUES (@Name, @Address);
END
GO
Reply
Answers (
2
)
Merge Statement do not use ID
update,insert,delete query in a table