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