ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
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???
 Question Submitted By :: Vampire007
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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???
Answer
# 1
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 ?    1 Yes 0 No
Madhu
 
  Re: 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???
Answer
# 2
Madhu, actually the answer which u have given is quite 
common. Now i m gonna tell u a new one. The above question 
has one more solution that is stated below:


"Insert into Table_name DEFAULT values"


that's it.
 
Is This Answer Correct ?    1 Yes 2 No
Deepak
 
 
 
  Re: 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???
Answer
# 3
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
Brahma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
can you any body tell me why are go for the rebuild the master database.what is the reason?  1
what is IDE,DMV in sql server? Value-Labs1
What is the difference between Stored Procedure , Function and Package, 1. how many blocks in Package and what are they. IBM5
How to give a user the option of importing Excel and a delimited text file into a SQL Server Database without manually using SQL DTS? GE1
What is the system function to get the current user's user id? TCS3
How to find out name of all employees who has salary less than 200 Rs.?  7
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal.  7
How do you read transaction logs  1
What is the advantage of specifying WITH GRANT OPTION in the GRANT command?  2
in emptable i want to retrive the name of employee whose name in 'J'char.exp: arjun,jagadesh,niranjan,anju,aaaj etc.  7
What is the difference between IN and EXISTS operators in SQL Server? Intelligroup3
What is the difference between temp table and table variable? Microsoft4
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? HCL1
Which virtual table does a trigger use?  3
How do you know which index a table is using?  4
How can I create a plain-text flat file from SQL Server as input to another application?  2
If there exist a index on the table, and we then make a view on that table (include the indexed column from base table) than why do we require indexing on view?Doesnt it create an overhead?  1
What is cursor ? And what is difference between Trigger ? HCL1
what is the diffrence between Snap Shot and Transaction Replication CSC1
what is the importence of the trigger in sqlserver2000? ATI1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com