Say if we have a table that contains only a single column ,
say OrderID, which has IDENTITY attribute defined on it. So
how can we insert data in this table.
I am reframing my question, that how can we make the table
to increment the column "OrderID" value several times???
Answers were Sorted based on User's Feedback
Answer / madhu
To insert values into Identity column use the
IDENTITY_INSERT option like
SET IDENTITY_INSERT Table_Name ON
Insert Table_Name
(OrderID)
Values(10)
SET IDENTITY_INSERT Table_Name OFF
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / brahma
create table t1(a int identity(1,1))
insert into t1 default value
set identity_insert t1 off
(or)
set identity_insert t1 on
Is This Answer Correct ? | 0 Yes | 0 No |
Explain different types of locks in sql server.
How to convert binary strings into integers in ms sql server?
What are functions in the sql server?
What is spid in sql server profiler?
Explain different backup plans?
Explain the steps needed to create a scheduled job?
What are rows and columns?
What is the use of keyword with encryption.
What are scalar functions?
How to skip remaining statements in a loop block using continue statements?
Explain partitioned view?
What is a file group?