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 |
What is the most common type of join?
You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
How to delete all rows with truncate table statement in ms sql server?
How to find Duplicate Records In table?
What is the purpose of update statistics and scope_identity() function?
What is onf in normalization form?
how we can store the value like that 001,003,023 etc in sql server 2005
Can we rewrite subqueries into simple select statements or with joins? Example?
What languages bi uses to achieve the goal?
can you any body tell me why are go for the rebuild the master database.what is the reason?
How use inner join in sql server?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)