Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to rest identity columns in sql server

Answers were Sorted based on User's Feedback



how to rest identity columns in sql server..

Answer / muthu kumar

create table t(id int identity(seed,increment))

where seed is starting number and increment is number to be
incremented.

create table t(id int identity(1,1),name varchar(50))

so the id will be start with 1 and will be incremented 1 by
1 each time when record is get insered

Is This Answer Correct ?    5 Yes 0 No

how to rest identity columns in sql server..

Answer / adhi

USE AdventureWorks;
GO
DBCC CHECKIDENT ("HumanResources.Employee", RESEED, 300);
GO

Is This Answer Correct ?    2 Yes 0 No

how to rest identity columns in sql server..

Answer / yvbchowdary

The identity is similar to squence object in oracle. syntax
for identity column is
<column-name> <data type> identity(start value,increment)
ex:
empno int identity(100,2)

suppose if u want to add an odd value i.e, 50; u can also
add
first execute IDENTITY_INSERT ON
and then u can insert whatever values u want. then again
execute IDENTITY_INSERT OFF

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

how do we find every fifth record in a table

14 Answers   Aspire, HCL,


what are different types of backups available in sql server? : Sql server database administration

0 Answers  


What is the difference between a local and a global temporary table?

0 Answers  


Name the different type of indexes in sql?

0 Answers  


Is the order of columns in the set clause important in ms sql server?

0 Answers  


can a database be shrunk to 0 bytes, if not, why? : Sql server administration

0 Answers  


whats new about truncate in sql server 2008?

0 Answers   MedSave Healthcare, Serco,


Explain about local stored procedure?

0 Answers  


What is SCOPE_IDENTITY() in sql

4 Answers   Cap Gemini,


Explain “row_number()” in sql server with an example?

0 Answers  


what r steps to we need to fallow b4 kill the process?

1 Answers   Verizon,


What are the restrictions applicable while creating views? : SQL Server Architecture

0 Answers  


Categories