Feeds:
Posts
Comments

Archive for the ‘MANAGEMENT COMMAND’ Category

In my earlier articles, I wrote about SQL Server 2012’s new features & enhancements.

In this article, we will discuss the slight modification made in DBCC CHECKIDENT management command in SQL server 2012. This modification is done in the result set area. If you execute DBCC CHECKIDENT command in earlier version, you get the same result set, whether it is “RESEED” or “NORESEED”.  But in SQL Server 2012, you can feel the difference in result set when it is “RESEED” or “NORESEED”.

Lets create a simple example to demonstrate it.

CREATE TABLE [dbo].[Employee](
      [Sno] [int] identity(1,1),
      [Employee ID] nvarchar(6) Not NULL ,
      [Emplloyee name] [varchar](50) NOT NULL
      )
GO
Insert into dbo.[Employee] values ('EMP001','Bob')
Insert into dbo.[Employee] values ('EMP002','Alexander')

Select * from dbo.[Employee]
GO

Lets execute the given below code in earlier versions of SQL Server and in SQL Server 2012 as well.

DBCC CHECKIDENT ('dbo.Employee',NORESEED);
GO
DBCC CHECKIDENT ('dbo.Employee',RESEED,2);
GO

dbcc_checkind1.1

Advertisements

Read Full Post »