T-SQL SP Error help

I'm working in Azure ... I create an SP
USE [azurevolking]
GO
/****** Object:  StoredProcedure [dbo].[InitializeTables]    Script Date: 10/27/2015 12:50:15 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[InitializeTables]
as

begin

delete from dbo.Persons;
delete from dbo.CONDITIONS;
delete from dbo.LIKETYPES;
DBCC CHECKIDENT ('Persons', RESEED)
DBCC CHECKIDENT ('CONDITIONS', RESEED)
DBCC CHECKIDENT ('LIKETYPES', RESEED)

/***CONDITIONS***************************************/
	if not exists(select [ConditionID] from [dbo].[Conditions] where [ConditionID]=1)
		begin
				SET IDENTITY_INSERT dbo.Conditions ON
				INSERT INTO dbo.Conditions (ConditionID, ConditionCode, Name) 
					VALUES (1, 'NEW','new')
		end
		/***PERSON***************************************/
	if not exists(select PersonID from dbo.persons where personid=1)
		begin
				SET IDENTITY_INSERT dbo.Persons ON
				INSERT INTO dbo.Persons (PersonID, name,handle,ismale, dob, zipcode) 
					VALUES (1, 'Frederick Volking','Frederick','Y', '08/14/1952','78660')
		end
		/***LIKETYPES***************************************/
	if not exists(select [LikeTypeID] from [dbo].[LikeTypes] where [LikeTypeID]=1)
		begin
				SET IDENTITY_INSERT dbo.LikeTypes ON
				INSERT INTO dbo.LikeTypes (LikeTypeID, name, PersonIDcreator, ConditionID) 
					VALUES (1, 'Food', 1, 1)
		end

end

Open in new window

and when SP executed I get error
Checking identity information: current identity value '1', current column value 'NULL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Checking identity information: current identity value '1', current column value 'NULL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Checking identity information: current identity value 'NULL', current column value 'NULL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

(1 row(s) affected)
Msg 8107, Level 16, State 1, Procedure InitializeTables, Line 24
[u]IDENTITY_INSERT is already ON for table 'azurevolking.dbo.Conditions'. Cannot perform SET operation for table 'dbo.Persons'.[/u]

Open in new window

LVL 5
volkingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
You have to turn off the IDENTITY_INSERT after each table.  It can only be active on a single table at a time.

SET IDENITY_INSERT dbo.Conditions OFF;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
volkingAuthor Commented:
Outstanding. Worked great
thx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.